mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 23:06:14 +00:00
vim-patch:8.2.3623: "$*" is expanded to "nonomatch"
Problem: "$*" is expanded to "nonomatch".
Solution: Only add "set nonomatch" when using a csh-like shell. (Christian
Brabandt, closes vim/vim#9159, closes vim/vim#9153)
8b8d829faf
Cherry-pick a line from patch 8.2.0522.
This commit is contained in:
@@ -249,10 +249,16 @@ int os_expand_wildcards(int num_pat, char **pat, int *num_file, char ***file, in
|
|||||||
}
|
}
|
||||||
STRCAT(command, ">");
|
STRCAT(command, ">");
|
||||||
} else {
|
} else {
|
||||||
if (flags & EW_NOTFOUND) {
|
STRCPY(command, "");
|
||||||
STRCPY(command, "set nonomatch; ");
|
if (shell_style == STYLE_GLOB) {
|
||||||
} else {
|
// Assume the nonomatch option is valid only for csh like shells,
|
||||||
STRCPY(command, "unset nonomatch; ");
|
// otherwise, this may set the positional parameters for the shell,
|
||||||
|
// e.g. "$*".
|
||||||
|
if (flags & EW_NOTFOUND) {
|
||||||
|
STRCAT(command, "set nonomatch; ");
|
||||||
|
} else {
|
||||||
|
STRCAT(command, "unset nonomatch; ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (shell_style == STYLE_GLOB) {
|
if (shell_style == STYLE_GLOB) {
|
||||||
STRCAT(command, "glob >");
|
STRCAT(command, "glob >");
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
" Test for expanding file names
|
" Test for expanding file names
|
||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
|
source check.vim
|
||||||
|
|
||||||
func Test_with_directories()
|
func Test_with_directories()
|
||||||
call mkdir('Xdir1')
|
call mkdir('Xdir1')
|
||||||
@@ -131,7 +132,13 @@ func Test_expand_filename_multicmd()
|
|||||||
call assert_equal(4, winnr('$'))
|
call assert_equal(4, winnr('$'))
|
||||||
call assert_equal('foo!', bufname(winbufnr(1)))
|
call assert_equal('foo!', bufname(winbufnr(1)))
|
||||||
call assert_equal('foo', bufname(winbufnr(2)))
|
call assert_equal('foo', bufname(winbufnr(2)))
|
||||||
|
call assert_fails('e %:s/.*//', 'E500:')
|
||||||
%bwipe!
|
%bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_expandcmd_shell_nonomatch()
|
||||||
|
CheckNotMSWindows
|
||||||
|
call assert_equal('$*', expandcmd('$*'))
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Reference in New Issue
Block a user