diff src/ex_getln.c @ 17543:77c3f6428b6c v8.1.1769

patch 8.1.1769: 'shellslash' is also used for completion commit https://github.com/vim/vim/commit/ac3150d385e6e3f3fe76642aac3cda954d30583f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 28 16:36:39 2019 +0200 patch 8.1.1769: 'shellslash' is also used for completion Problem: 'shellslash' is also used for completion. Solution: Add the 'completeslash' option. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/3612)
author Bram Moolenaar <Bram@vim.org>
date Sun, 28 Jul 2019 16:45:05 +0200
parents e43f0c0c491c
children 1348696d07cd
line wrap: on
line diff
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -5095,6 +5095,26 @@ ExpandFromContext(
 	ret = expand_wildcards_eval(&pat, num_file, file, flags);
 	if (free_pat)
 	    vim_free(pat);
+#ifdef BACKSLASH_IN_FILENAME
+	if (p_csl[0] != NUL)
+	{
+	    int	    i;
+
+	    for (i = 0; i < *num_file; ++i)
+	    {
+		char_u	*ptr = (*file)[i];
+
+		while (*ptr != NUL)
+		{
+		    if (p_csl[0] == 's' && *ptr == '\\')
+			*ptr = '/';
+		    else if (p_csl[0] == 'b' && *ptr == '/')
+			*ptr = '\\';
+		    ptr += (*mb_ptr2len)(ptr);
+		}
+	    }
+	}
+#endif
 	return ret;
     }