summaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-08-29 12:58:44 +0200
committerBram Moolenaar <Bram@vim.org>2014-08-29 12:58:44 +0200
commite4df164692fef1a3c94149e1e2af68d44d335bf9 (patch)
tree983243c06916767b26eac240452e4a6d46e2994a /src/os_unix.c
parent49f9dd7b916fb32bfd0cc9a50f8c4f9bb1bb760b (diff)
downloadvim-git-e4df164692fef1a3c94149e1e2af68d44d335bf9.tar.gz
updated for version 7.4.423v7.4.423
Problem: expand("$shell") does not work as documented. Solution: Do not escape the $ when expanding environment variables.
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 124c2693b..b49afc3f8 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5939,10 +5939,12 @@ mch_expand_wildcards(num_pat, pat, num_file, file, flags)
*p++ = '\\';
++j;
}
- else if (!intick && vim_strchr(SHELL_SPECIAL,
- pat[i][j]) != NULL)
+ else if (!intick
+ && ((flags & EW_KEEPDOLLAR) == 0 || pat[i][j] != '$')
+ && vim_strchr(SHELL_SPECIAL, pat[i][j]) != NULL)
/* Put a backslash before a special character, but not
- * when inside ``. */
+ * when inside ``. And not for $var when EW_KEEPDOLLAR is
+ * set. */
*p++ = '\\';
/* Copy one character. */