Mercurial > vim
comparison src/structs.h @ 14917:6f2ce3b311de v8.1.0470
patch 8.1.0470: pointer ownership around fname_expand() is unclear
commit https://github.com/vim/vim/commit/3d6014f0336d9a64c01a7518fe45fde0a925fa20
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 11 19:27:47 2018 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 11 Oct 2018 19:30:05 +0200 |
parents | a8ed1cb85859 |
children | 162d79d273e6 |
comparison
equal
deleted
inserted
replaced
14916:11372e362ffc | 14917:6f2ce3b311de |
---|---|
1970 * b_ffname has the full path of the file (NULL for no name). | 1970 * b_ffname has the full path of the file (NULL for no name). |
1971 * b_sfname is the name as the user typed it (or NULL). | 1971 * b_sfname is the name as the user typed it (or NULL). |
1972 * b_fname is the same as b_sfname, unless ":cd" has been done, | 1972 * b_fname is the same as b_sfname, unless ":cd" has been done, |
1973 * then it is the same as b_ffname (NULL for no name). | 1973 * then it is the same as b_ffname (NULL for no name). |
1974 */ | 1974 */ |
1975 char_u *b_ffname; /* full path file name */ | 1975 char_u *b_ffname; // full path file name, allocated |
1976 char_u *b_sfname; /* short file name */ | 1976 char_u *b_sfname; // short file name, allocated, may be equal to |
1977 char_u *b_fname; /* current file name */ | 1977 // b_ffname |
1978 char_u *b_fname; // current file name, points to b_ffname or | |
1979 // b_sfname | |
1978 | 1980 |
1979 #ifdef UNIX | 1981 #ifdef UNIX |
1980 int b_dev_valid; /* TRUE when b_dev has a valid number */ | 1982 int b_dev_valid; /* TRUE when b_dev has a valid number */ |
1981 dev_t b_dev; /* device number */ | 1983 dev_t b_dev; /* device number */ |
1982 ino_t b_ino; /* inode number */ | 1984 ino_t b_ino; /* inode number */ |