summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2022-03-10 12:24:02 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-10 12:24:02 +0000
commit81da16b53fbf804a3cd32bc15313c96444b71484 (patch)
treebfe627416f346e912d11e95c8e3f61899f9b25af /src
parentf8691004b069f67becd657a02100d7521d1255a9 (diff)
patch 8.2.4535: filename modifer ":8" removes the filenamev8.2.4535
Problem: Filename modifer ":8" removes the filename. Solution: Use strncpy() instead of vim_strncpy(). (Christian Brabandt, closes #9918, closes #8600)
Diffstat (limited to 'src')
-rw-r--r--src/filepath.c2
-rw-r--r--src/testdir/test_shortpathname.vim5
-rw-r--r--src/version.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/src/filepath.c b/src/filepath.c
index 7a5dae441f..f0da60f452 100644
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -186,7 +186,7 @@ shortpath_for_invalid_fname(
// unless get_short_pathname() did its work in-place.
*fname = *bufp = save_fname;
if (short_fname != save_fname)
- vim_strncpy(save_fname, short_fname, len);
+ STRNCPY(save_fname, short_fname, len);
save_fname = NULL;
}
diff --git a/src/testdir/test_shortpathname.vim b/src/testdir/test_shortpathname.vim
index f5fa1185a1..13fc07999d 100644
--- a/src/testdir/test_shortpathname.vim
+++ b/src/testdir/test_shortpathname.vim
@@ -88,4 +88,9 @@ func Test_ColonEight_MultiByte()
call delete(dir, 'd')
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
diff --git a/src/version.c b/src/version.c
index 5e5a2a8aa2..49810ea00f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4535,
+/**/
4534,
/**/
4533,