diff options
-rw-r--r-- | src/nvim/path.c | 30 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 16 insertions, 16 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index e0e5f19911..75b34339dd 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -1117,6 +1117,7 @@ int gen_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u *p; static bool recursive = false; int add_pat; + bool retval = OK; bool did_expand_in_path = false; /* @@ -1158,12 +1159,13 @@ int gen_expand_wildcards(int num_pat, char_u **pat, int *num_file, add_pat = -1; p = pat[i]; - if (vim_backtick(p)) + if (vim_backtick(p)) { add_pat = expand_backtick(&ga, p, flags); - else { - /* - * First expand environment variables, "~/" and "~user/". - */ + if (add_pat == -1) { + retval = FAIL; + } + } else { + // First expand environment variables, "~/" and "~user/". if (has_env_var(p) || *p == '~') { p = expand_env_save_opt(p, true); if (p == NULL) @@ -1234,7 +1236,7 @@ int gen_expand_wildcards(int num_pat, char_u **pat, int *num_file, recursive = false; - return (ga.ga_data != NULL) ? OK : FAIL; + return (ga.ga_data != NULL) ? retval : FAIL; } @@ -1246,13 +1248,10 @@ static int vim_backtick(char_u *p) return *p == '`' && *(p + 1) != NUL && *(p + STRLEN(p) - 1) == '`'; } -/* - * Expand an item in `backticks` by executing it as a command. - * Currently only works when pat[] starts and ends with a `. - * Returns number of file names found. - */ -static int -expand_backtick ( +// Expand an item in `backticks` by executing it as a command. +// Currently only works when pat[] starts and ends with a `. +// Returns number of file names found, -1 if an error is encountered. +static int expand_backtick( garray_T *gap, char_u *pat, int flags /* EW_* flags */ @@ -1273,8 +1272,9 @@ expand_backtick ( buffer = get_cmd_output(cmd, NULL, (flags & EW_SILENT) ? kShellOptSilent : 0, NULL); xfree(cmd); - if (buffer == NULL) - return 0; + if (buffer == NULL) { + return -1; + } cmd = buffer; while (*cmd != NUL) { diff --git a/src/nvim/version.c b/src/nvim/version.c index 7d4b8982cd..6fdad105e4 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -459,7 +459,7 @@ static int included_patches[] = { 834, 833, // 832, - // 831, + 831, 830, // 829 NA 828, |