vim-patch:7.4.1654

Problem:    Crash when using expand('%:S') in a buffer without a name.
Solution:   Don't set a NUL. (James McCoy, closes vim/vim#714)

52c6eaffd4
This commit is contained in:
James McCoy
2016-03-28 09:47:46 -04:00
parent 62c0d99474
commit 7558f42f7d
3 changed files with 18 additions and 2 deletions

View File

@@ -21995,9 +21995,13 @@ repeat:
if (src[*usedlen] == ':' && src[*usedlen + 1] == 'S') {
// vim_strsave_shellescape() needs a NUL terminated string.
c = (*fnamep)[*fnamelen];
(*fnamep)[*fnamelen] = NUL;
if (c != NUL) {
(*fnamep)[*fnamelen] = NUL;
}
p = vim_strsave_shellescape(*fnamep, false, false);
(*fnamep)[*fnamelen] = c;
if (c != NUL) {
(*fnamep)[*fnamelen] = c;
}
xfree(*bufp);
*bufp = *fnamep = p;
*fnamelen = STRLEN(p);