0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1959: crash when terminal buffer name is made empty

Problem:    Crash when terminal buffer name is made empty. (Dhiraj Mishra)
Solution:   Fall back to "[No Name]". (closes #7262)
This commit is contained in:
Bram Moolenaar
2020-11-05 19:36:38 +01:00
parent b885b435d1
commit 00806bceb6
5 changed files with 30 additions and 4 deletions

View File

@@ -5648,10 +5648,21 @@ buf_spname(buf_T *buf)
}
if (buf->b_fname == NULL)
return (char_u *)_("[No Name]");
return buf_get_fname(buf);
return NULL;
}
/*
* Get "buf->b_fname", use "[No Name]" if it is NULL.
*/
char_u *
buf_get_fname(buf_T *buf)
{
if (buf->b_fname == NULL)
return (char_u *)_("[No Name]");
return buf->b_fname;
}
/*
* Set 'buflisted' for curbuf to "on" and trigger autocommands if it changed.
*/