0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.4535: filename modifer ":8" removes the filename

Problem:    Filename modifer ":8" removes the filename.
Solution:   Use strncpy() instead of vim_strncpy(). (Christian Brabandt,
            closes #9918, closes #8600)
This commit is contained in:
Christian Brabandt
2022-03-10 12:24:02 +00:00
committed by Bram Moolenaar
parent f8691004b0
commit 81da16b53f
3 changed files with 8 additions and 1 deletions

View File

@@ -186,7 +186,7 @@ shortpath_for_invalid_fname(
// unless get_short_pathname() did its work in-place. // unless get_short_pathname() did its work in-place.
*fname = *bufp = save_fname; *fname = *bufp = save_fname;
if (short_fname != save_fname) if (short_fname != save_fname)
vim_strncpy(save_fname, short_fname, len); STRNCPY(save_fname, short_fname, len);
save_fname = NULL; save_fname = NULL;
} }

View File

@@ -88,4 +88,9 @@ func Test_ColonEight_MultiByte()
call delete(dir, 'd') call delete(dir, 'd')
endfunc endfunc
func Test_ColonEight_notexists()
let non_exists='C:\windows\newfile.txt'
call assert_equal(non_exists, fnamemodify(non_exists, ':p:8'))
endfunc
" vim: shiftwidth=2 sts=2 expandtab " vim: shiftwidth=2 sts=2 expandtab

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
4535,
/**/ /**/
4534, 4534,
/**/ /**/