aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/shell.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-08-21 23:26:49 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-08-21 23:26:49 -0600
commit73ede4a508517f8e55c75d710f13851eb8079875 (patch)
treeb4cccc61b70c28b1474d74d2ff4bff856929cdca /src/nvim/os/shell.c
parent8436383af96dc7afa3596fc22c012d68e76f47f8 (diff)
parent72b03792b6428ca96ca779b53061c6c98f6f930f (diff)
downloadrneovim-73ede4a508517f8e55c75d710f13851eb8079875.tar.gz
rneovim-73ede4a508517f8e55c75d710f13851eb8079875.tar.bz2
rneovim-73ede4a508517f8e55c75d710f13851eb8079875.zip
Merge remote-tracking branch 'upstream/master' into usermarks
Diffstat (limited to 'src/nvim/os/shell.c')
-rw-r--r--src/nvim/os/shell.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index 8f2018c1f4..b793b8f9c6 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -25,6 +25,7 @@
#include "nvim/os/shell.h"
#include "nvim/os/signal.h"
#include "nvim/path.h"
+#include "nvim/profile.h"
#include "nvim/screen.h"
#include "nvim/strings.h"
#include "nvim/tag.h"
@@ -248,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 >");