diff src/ex_docmd.c @ 22588:050cff1294ab v8.2.1842

patch 8.2.1842: crash when USE_FNAME_CASE is defined and using :browse Commit: https://github.com/vim/vim/commit/21cbe175eece17fad21d7403b00422445b587138 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Oct 13 19:08:24 2020 +0200 patch 8.2.1842: crash when USE_FNAME_CASE is defined and using :browse Problem: Crash when USE_FNAME_CASE is defined and using :browse. Solution: Don't use read-only memory for ".". (Yegappan Lakshmanan, closes #7123)
author Bram Moolenaar <Bram@vim.org>
date Tue, 13 Oct 2020 19:15:04 +0200
parents 715e8f14f314
children 08e2363fd0de
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -6084,6 +6084,7 @@ ex_splitview(exarg_T *eap)
     char_u	*fname = NULL;
 #endif
 #ifdef FEAT_BROWSE
+    char_u	dot_path[] = ".";
     int		browse_flag = cmdmod.browse;
 #endif
     int		use_tab = eap->cmdidx == CMD_tabedit
@@ -6136,7 +6137,7 @@ ex_splitview(exarg_T *eap)
 	    // No browsing supported but we do have the file explorer:
 	    // Edit the directory.
 	    if (*eap->arg == NUL || !mch_isdir(eap->arg))
-		eap->arg = (char_u *)".";
+		eap->arg = dot_path;
 	}
 	else
 	{