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)
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index a55fae7..6371ece 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2465,6 +2465,7 @@
bufref_T old_curbuf;
char_u *free_fname = NULL;
#ifdef FEAT_BROWSE
+ char_u dot_path[] = ".";
char_u *browse_file = NULL;
#endif
int retval = FAIL;
@@ -2511,7 +2512,7 @@
// No browsing supported but we do have the file explorer:
// Edit the directory.
if (ffname == NULL || !mch_isdir(ffname))
- ffname = (char_u *)".";
+ ffname = dot_path;
}
else
{