summaryrefslogtreecommitdiffstats
path: root/src/structs.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-10-11 19:27:47 +0200
committerBram Moolenaar <Bram@vim.org>2018-10-11 19:27:47 +0200
commit3d6014f0336d9a64c01a7518fe45fde0a925fa20 (patch)
tree7961f41f09ee54c2c240abac007ab9779709bb13 /src/structs.h
parent108e7b422b7b59153dd5af1fb75e83fa36ff3db4 (diff)
patch 8.1.0470: pointer ownership around fname_expand() is unclearv8.1.0470
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.
Diffstat (limited to 'src/structs.h')
-rw-r--r--src/structs.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/structs.h b/src/structs.h
index da4ffb8568..ad03cd4776 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1972,9 +1972,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
#ifdef UNIX
int b_dev_valid; /* TRUE when b_dev has a valid number */