Patch 8.2.4074
Problem:    Going over the end of NameBuff.
Solution:   Check length when appending a space.
Files:      src/drawscreen.c, src/testdir/test_edit.vim


*** ../vim-8.2.4073/src/drawscreen.c    2021-12-13 21:59:04.895993159 +0000
--- src/drawscreen.c    2022-01-13 13:06:19.684076974 +0000
***************
*** 462,473 ****
        p = NameBuff;
        len = (int)STRLEN(p);
  
!       if (bt_help(wp->w_buffer)
  #ifdef FEAT_QUICKFIX
!               || wp->w_p_pvw
  #endif
!               || bufIsChanged(wp->w_buffer)
!               || wp->w_buffer->b_p_ro)
            *(p + len++) = ' ';
        if (bt_help(wp->w_buffer))
        {
--- 462,474 ----
        p = NameBuff;
        len = (int)STRLEN(p);
  
!       if ((bt_help(wp->w_buffer)
  #ifdef FEAT_QUICKFIX
!                   || wp->w_p_pvw
  #endif
!                   || bufIsChanged(wp->w_buffer)
!                   || wp->w_buffer->b_p_ro)
!               && len < MAXPATHL - 1)
            *(p + len++) = ' ';
        if (bt_help(wp->w_buffer))
        {
*** ../vim-8.2.4073/src/testdir/test_edit.vim   2022-01-03 11:03:42.538752401 
+0000
--- src/testdir/test_edit.vim   2022-01-13 13:03:54.248250718 +0000
***************
*** 2103,2107 ****
--- 2103,2122 ----
    bwipe!
  endfunc
  
+ " Weird long file name was going over the end of NameBuff
+ func Test_edit_overlong_file_name()
+   CheckUnix
+ 
+   file 0000000000000000000000000000
+   file %%%%%%%%%%%%%%%%%%%%%%%%%%
+   file %%%%%%
+   set readonly
+   set ls=2 
+ 
+   redraw!
+   set noreadonly ls&
+   bwipe!
+ endfunc
+ 
  
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.4073/src/version.c       2022-01-13 12:05:03.489321507 +0000
--- src/version.c       2022-01-13 13:06:12.508087055 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4074,
  /**/

-- 
You cannot propel yourself forward by patting yourself on the back.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220113130858.ADBE91C0329%40moolenaar.net.

Raspunde prin e-mail lui