aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer_defs.h
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-12-19 21:58:33 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-12-19 22:52:30 -0500
commit7390cc8b2905a5831ad870a240496b8c355fa9b1 (patch)
treeabfa1cdc27e30e8a7163de34d1af0a3125072c8b /src/nvim/buffer_defs.h
parente465157ecd8b49d71ad9b59f24c7aef33a9c402d (diff)
downloadrneovim-7390cc8b2905a5831ad870a240496b8c355fa9b1.tar.gz
rneovim-7390cc8b2905a5831ad870a240496b8c355fa9b1.tar.bz2
rneovim-7390cc8b2905a5831ad870a240496b8c355fa9b1.zip
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. https://github.com/vim/vim/commit/3d6014f0336d9a64c01a7518fe45fde0a925fa20
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r--src/nvim/buffer_defs.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 44a9b39939..cc09b7e989 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -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;