Mercurial > vim
diff src/ex_cmds.c @ 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 | d4777be849d0 |
children | e3910b9827d0 |
line wrap: on
line diff
--- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -3648,8 +3648,8 @@ check_readonly(int *forceit, buf_T *buf) } /* - * Try to abandon current file and edit a new or existing file. - * "fnum" is the number of the file, if zero use ffname/sfname. + * Try to abandon the current file and edit a new or existing file. + * "fnum" is the number of the file, if zero use "ffname_arg"/"sfname_arg". * "lnum" is the line number for the cursor in the new file (if non-zero). * * Return: @@ -3661,12 +3661,14 @@ check_readonly(int *forceit, buf_T *buf) int getfile( int fnum, - char_u *ffname, - char_u *sfname, + char_u *ffname_arg, + char_u *sfname_arg, int setpm, linenr_T lnum, int forceit) { + char_u *ffname = ffname_arg; + char_u *sfname = sfname_arg; int other; int retval; char_u *free_me = NULL;