diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-01-25 22:10:52 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-01-25 22:10:52 +0000 |
commit | d12f5c17be85407b7beb8622828ba6bc5903369e (patch) | |
tree | cb86c7b532ba41cd2f914bd2e2636acc09c99fe1 /src/os_unix.c | |
parent | 28c258fd24342fe52e85059d68ce69cf9ef5f8cd (diff) | |
download | vim-git-d12f5c17be85407b7beb8622828ba6bc5903369e.tar.gz |
updated for version 7.0187v7.0187
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index afc68ff84..374d85e76 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -4852,7 +4852,7 @@ mch_expandpath(gap, path, flags) # define SEEK_END 2 #endif -#define SHELL_SPECIAL (char_u *)"\t \"&';<>\\|" +#define SHELL_SPECIAL (char_u *)"\t \"&';<>()\\|" /* ARGSUSED */ int @@ -5128,7 +5128,12 @@ mch_expand_wildcards(num_pat, pat, num_file, file, flags) } else if (pat[i][j] == '\\' && pat[i][j + 1] != NUL) { - /* Remove a backslash, take char literally. */ + /* Remove a backslash, take char literally. But keep + * backslash before special character and inside + * backticks. */ + if (intick + || vim_strchr(SHELL_SPECIAL, pat[i][j + 1]) != NULL) + *p++ = '\\'; *p++ = pat[i][++j]; } else if (!intick && vim_strchr(SHELL_SPECIAL, @@ -5140,12 +5145,8 @@ mch_expand_wildcards(num_pat, pat, num_file, file, flags) *p++ = pat[i][j]; } else - { - /* For a backslash also copy the next character, don't - * want to put quotes around it. */ - if ((*p++ = pat[i][j]) == '\\' && pat[i][j + 1] != NUL) - *p++ = pat[i][++j]; - } + /* Simply copy the character. */ + *p++ = pat[i][++j]; } *p = NUL; #endif |