diff src/evalfunc.c @ 22397:0a5770061295 v8.2.1747

patch 8.2.1747: result of expand() unexpectedly depends on 'completeslash' Commit: https://github.com/vim/vim/commit/8f187fc6304222956f94a700758a490cc8c0af99 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 26 18:47:11 2020 +0200 patch 8.2.1747: result of expand() unexpectedly depends on 'completeslash' Problem: Result of expand() unexpectedly depends on 'completeslash'. Solution: Temporarily reset 'completeslash'. (Yasuhiro Matsumoto, closes #7021)
author Bram Moolenaar <Bram@vim.org>
date Sat, 26 Sep 2020 19:00:03 +0200
parents 770fe121ca64
children 0ef3ae4ec70e
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -2436,6 +2436,12 @@ f_expand(typval_T *argvars, typval_T *re
     expand_T	xpc;
     int		error = FALSE;
     char_u	*result;
+#ifdef BACKSLASH_IN_FILENAME
+    char_u	*p_csl_save = p_csl;
+
+    // avoid using 'completeslash' here
+    p_csl = empty_option;
+#endif
 
     rettv->v_type = VAR_STRING;
     if (argvars[1].v_type != VAR_UNKNOWN
@@ -2488,6 +2494,9 @@ f_expand(typval_T *argvars, typval_T *re
 	else
 	    rettv->vval.v_string = NULL;
     }
+#ifdef BACKSLASH_IN_FILENAME
+    p_csl = p_csl_save;
+#endif
 }
 
 /*