diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-10-17 17:20:23 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-10-17 17:20:23 +0100 |
commit | 21c1a0c2f10575dbb72fa873d33f0c1f6e170aa7 (patch) | |
tree | ab2a99240a83610e85c5d2632553266406d983ef /src/cmdexpand.c | |
parent | 34a364877f0c726cdc0779e6999fded9ba959ebe (diff) |
patch 8.2.3530: ":buf \{a}" fails while ":edit \{a}" worksv8.2.3530
Problem: ":buf \{a}" fails while ":edit \{a}" works.
Solution: Unescape "\{". (closes #8917)
Diffstat (limited to 'src/cmdexpand.c')
-rw-r--r-- | src/cmdexpand.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c index c36c21a3d8..c98e126a5c 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -48,6 +48,8 @@ ExpandEscape( { int i; char_u *p; + int vse_what = xp->xp_context == EXPAND_BUFFERS + ? VSE_BUFFER : VSE_NONE; // May change home directory back to "~" if (options & WILD_HOME_REPLACE) @@ -84,9 +86,10 @@ ExpandEscape( } } #ifdef BACKSLASH_IN_FILENAME - p = vim_strsave_fnameescape(files[i], FALSE); + p = vim_strsave_fnameescape(files[i], vse_what); #else - p = vim_strsave_fnameescape(files[i], xp->xp_shell); + p = vim_strsave_fnameescape(files[i], + xp->xp_shell ? VSE_SHELL : vse_what); #endif if (p != NULL) { |