diff options
-rw-r--r-- | src/filepath.c | 18 | ||||
-rw-r--r-- | src/testdir/test_fnamemodify.vim | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 15 insertions, 7 deletions
diff --git a/src/filepath.c b/src/filepath.c index 9a5d127ec..79eb7bf98 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -448,14 +448,18 @@ repeat: if (fnamencmp(p, dirname, namelen) == 0) { p += namelen; - while (*p && vim_ispathsep(*p)) - ++p; - *fnamep = p; - if (pbuf != NULL) + if (vim_ispathsep(*p)) { - vim_free(*bufp); // free any allocated file name - *bufp = pbuf; - pbuf = NULL; + while (*p && vim_ispathsep(*p)) + ++p; + *fnamep = p; + if (pbuf != NULL) + { + // free any allocated file name + vim_free(*bufp); + *bufp = pbuf; + pbuf = NULL; + } } } } diff --git a/src/testdir/test_fnamemodify.vim b/src/testdir/test_fnamemodify.vim index 7a21efef8..b35f15340 100644 --- a/src/testdir/test_fnamemodify.vim +++ b/src/testdir/test_fnamemodify.vim @@ -36,6 +36,8 @@ func Test_fnamemodify() call chdir($HOME . '/XXXXXXXX/a/') call assert_equal('foo', fnamemodify($HOME . '/XXXXXXXX/a/foo', ':p:~:.')) call assert_equal('~/XXXXXXXX/b/foo', fnamemodify($HOME . '/XXXXXXXX/b/foo', ':p:~:.')) + call mkdir($HOME . '/XXXXXXXX/a.ext', 'p') + call assert_equal('~/XXXXXXXX/a.ext/foo', fnamemodify($HOME . '/XXXXXXXX/a.ext/foo', ':p:~:.')) call chdir(cwd) call delete($HOME . '/XXXXXXXX', 'rf') diff --git a/src/version.c b/src/version.c index 97584e37e..20a6be433 100644 --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 215, +/**/ 214, /**/ 213, |