Patch 8.2.1842

8 views
Skip to first unread message

Bram Moolenaar

unread,
Oct 13, 2020, 1:09:03 PM10/13/20
to vim...@googlegroups.com

Patch 8.2.1842
Problem: Crash when USE_FNAME_CASE is defined and using :browse.
Solution: Don't use read-only memory for ".". (Yegappan Lakshmanan,
closes #7123)
Files: src/ex_cmds.c, src/ex_docmd.c, src/testdir/test_edit.vim


*** ../vim-8.2.1841/src/ex_cmds.c 2020-10-04 19:56:35.163869162 +0200
--- src/ex_cmds.c 2020-10-13 19:03:31.016086436 +0200
***************
*** 2465,2470 ****
--- 2465,2471 ----
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,2517 ****
// No browsing supported but we do have the file explorer:
// Edit the directory.
if (ffname == NULL || !mch_isdir(ffname))
! ffname = (char_u *)".";
}
else
{
--- 2512,2518 ----
// No browsing supported but we do have the file explorer:
// Edit the directory.
if (ffname == NULL || !mch_isdir(ffname))
! ffname = dot_path;
}
else
{
*** ../vim-8.2.1841/src/ex_docmd.c 2020-10-10 22:26:48.544313762 +0200
--- src/ex_docmd.c 2020-10-13 19:03:31.016086436 +0200
***************
*** 6084,6089 ****
--- 6084,6090 ----
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,6142 ****
// 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 *)".";
}
else
{
--- 6137,6143 ----
// No browsing supported but we do have the file explorer:
// Edit the directory.
if (*eap->arg == NUL || !mch_isdir(eap->arg))
! eap->arg = dot_path;
}
else
{
*** ../vim-8.2.1841/src/testdir/test_edit.vim 2020-10-03 17:04:34.114272292 +0200
--- src/testdir/test_edit.vim 2020-10-13 19:02:22.524179471 +0200
***************
*** 1805,1808 ****
--- 1805,1826 ----
close!
endfunc

+ func Test_edit_browse()
+ " in the GUI this opens a file picker, we only test the terminal behavior
+ CheckNotGui
+
+ " ":browse xxx" checks for the FileExplorer augroup and assumes editing "."
+ " works then.
+ augroup FileExplorer
+ au!
+ augroup END
+
+ " When the USE_FNAME_CASE is defined this used to cause a crash.
+ browse enew
+ bwipe!
+
+ browse split
+ bwipe!
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.1841/src/version.c 2020-10-13 18:38:07.432468135 +0200
--- src/version.c 2020-10-13 19:02:04.276201637 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1842,
/**/

--
hundred-and-one symptoms of being an internet addict:
84. Books in your bookcase bear the names Bongo, WinSock and Inside OLE

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages