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:
13
src/buffer.c
13
src/buffer.c
@@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user