vim-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.
3d6014f033
This commit is contained in:
Jan Edmund Lazo
2020-12-19 21:58:33 -05:00
parent e465157ecd
commit 7390cc8b29
4 changed files with 67 additions and 41 deletions

View File

@@ -533,9 +533,11 @@ struct file_buffer {
// b_fname is the same as b_sfname, unless ":cd" has been done,
// then it is the same as b_ffname (NULL for no name).
//
char_u *b_ffname; // full path file name
char_u *b_sfname; // short file name
char_u *b_fname; // current file name
char_u *b_ffname; // full path file name, allocated
char_u *b_sfname; // short file name, allocated, may be equal to
// b_ffname
char_u *b_fname; // current file name, points to b_ffname or
// b_sfname
bool file_id_valid;
FileID file_id;