patch 8.2.3530: ":buf \{a}" fails while ":edit \{a}" works
Problem: ":buf \{a}" fails while ":edit \{a}" works.
Solution: Unescape "\{". (closes #8917)
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index c36c21a..c98e126 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -48,6 +48,8 @@
{
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 @@
}
}
#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)
{