mirror of
https://github.com/neovim/neovim.git
synced 2025-10-13 13:26:06 +00:00
vim-patch:8.2.4074: going over the end of NameBuff
Problem: Going over the end of NameBuff.
Solution: Check length when appending a space.
de05bb2573
This commit is contained in:
@@ -80,10 +80,11 @@ void win_redr_status(win_T *wp)
|
|||||||
p = (char_u *)NameBuff;
|
p = (char_u *)NameBuff;
|
||||||
len = (int)STRLEN(p);
|
len = (int)STRLEN(p);
|
||||||
|
|
||||||
if (bt_help(wp->w_buffer)
|
if ((bt_help(wp->w_buffer)
|
||||||
|| wp->w_p_pvw
|
|| wp->w_p_pvw
|
||||||
|| bufIsChanged(wp->w_buffer)
|
|| bufIsChanged(wp->w_buffer)
|
||||||
|| wp->w_buffer->b_p_ro) {
|
|| wp->w_buffer->b_p_ro)
|
||||||
|
&& len < MAXPATHL - 1) {
|
||||||
*(p + len++) = ' ';
|
*(p + len++) = ' ';
|
||||||
}
|
}
|
||||||
if (bt_help(wp->w_buffer)) {
|
if (bt_help(wp->w_buffer)) {
|
||||||
|
@@ -1983,5 +1983,20 @@ func Test_edit_CTRL_hat()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
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: shiftwidth=2 sts=2 expandtab
|
||||||
|
Reference in New Issue
Block a user