aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/shell.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-20 07:49:31 +0800
committerGitHub <noreply@github.com>2022-08-20 07:49:31 +0800
commit1a57cd383684b7488e02e094f49dfe607bc53632 (patch)
tree5c52e5eeb62d73a7a9ec549bb70a5599024ccf76 /src/nvim/os/shell.c
parentf342194396df126093f4575cea3a8546a6ba30a5 (diff)
parent15ca01b649fb35186f1eb9b4422c36f9d8d2c8b4 (diff)
downloadrneovim-1a57cd383684b7488e02e094f49dfe607bc53632.tar.gz
rneovim-1a57cd383684b7488e02e094f49dfe607bc53632.tar.bz2
rneovim-1a57cd383684b7488e02e094f49dfe607bc53632.zip
Merge pull request #19852 from zeertzjq/vim-8.2.3623
vim-patch:8.2.{3623,4667}: expandcmd() fixes
Diffstat (limited to 'src/nvim/os/shell.c')
-rw-r--r--src/nvim/os/shell.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index dd44cb1ce7..b793b8f9c6 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -249,10 +249,16 @@ int os_expand_wildcards(int num_pat, char **pat, int *num_file, char ***file, in
}
STRCAT(command, ">");
} else {
- if (flags & EW_NOTFOUND) {
- STRCPY(command, "set nonomatch; ");
- } else {
- STRCPY(command, "unset nonomatch; ");
+ STRCPY(command, "");
+ if (shell_style == STYLE_GLOB) {
+ // Assume the nonomatch option is valid only for csh like shells,
+ // 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) {
STRCAT(command, "glob >");