mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.0470: pointer ownership around fname_expand() is unclear
Problem: Pointer ownership around fname_expand() is unclear. Solution: Allow b_ffname and b_sfname to point to the same allocated memory, only free one. Update comments.
This commit is contained in:
@@ -6187,7 +6187,8 @@ shorten_buf_fname(buf_T *buf, char_u *dirname, int force)
|
||||
|| buf->b_sfname == NULL
|
||||
|| mch_isFullName(buf->b_sfname)))
|
||||
{
|
||||
VIM_CLEAR(buf->b_sfname);
|
||||
if (buf->b_sfname != buf->b_ffname)
|
||||
VIM_CLEAR(buf->b_sfname);
|
||||
p = shorten_fname(buf->b_ffname, dirname);
|
||||
if (p != NULL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user