From c780075afad41fd4de30212845becdca83c4dd7c Mon Sep 17 00:00:00 2001 From: Florian Walch Date: Thu, 18 Dec 2014 15:35:13 +0100 Subject: vim-patch:7.4.423 Problem: expand("$shell") does not work as documented. Solution: Do not escape the $ when expanding environment variables. https://code.google.com/p/vim/source/detail?r=v7-4-423 --- src/nvim/os_unix.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/nvim/os_unix.c') diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index a9c1fec0b4..612f475933 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -1066,10 +1066,12 @@ int mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, || pat[i][j + 1] == '`') *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. */ -- cgit