Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
22587:1e0d1c677ae1 | 22588:050cff1294ab |
---|---|
6082 win_T *old_curwin = curwin; | 6082 win_T *old_curwin = curwin; |
6083 #if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE) | 6083 #if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE) |
6084 char_u *fname = NULL; | 6084 char_u *fname = NULL; |
6085 #endif | 6085 #endif |
6086 #ifdef FEAT_BROWSE | 6086 #ifdef FEAT_BROWSE |
6087 char_u dot_path[] = "."; | |
6087 int browse_flag = cmdmod.browse; | 6088 int browse_flag = cmdmod.browse; |
6088 #endif | 6089 #endif |
6089 int use_tab = eap->cmdidx == CMD_tabedit | 6090 int use_tab = eap->cmdidx == CMD_tabedit |
6090 || eap->cmdidx == CMD_tabfind | 6091 || eap->cmdidx == CMD_tabfind |
6091 || eap->cmdidx == CMD_tabnew; | 6092 || eap->cmdidx == CMD_tabnew; |
6134 au_has_group((char_u *)"FileExplorer")) | 6135 au_has_group((char_u *)"FileExplorer")) |
6135 { | 6136 { |
6136 // No browsing supported but we do have the file explorer: | 6137 // No browsing supported but we do have the file explorer: |
6137 // Edit the directory. | 6138 // Edit the directory. |
6138 if (*eap->arg == NUL || !mch_isdir(eap->arg)) | 6139 if (*eap->arg == NUL || !mch_isdir(eap->arg)) |
6139 eap->arg = (char_u *)"."; | 6140 eap->arg = dot_path; |
6140 } | 6141 } |
6141 else | 6142 else |
6142 { | 6143 { |
6143 fname = do_browse(0, (char_u *)(use_tab | 6144 fname = do_browse(0, (char_u *)(use_tab |
6144 ? _("Edit File in new tab page") | 6145 ? _("Edit File in new tab page") |