diff --git a/src/fileio.c b/src/fileio.c index 0a4ca648d8..9aceaf8876 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3457,7 +3457,9 @@ shorten_fname(char_u *full_path, char_u *dir_name) #endif { if (vim_ispathsep(*p)) - ++p; + do + ++p; + while (vim_ispathsep_nocolon(*p)); #ifndef VMS // the path separator is always part of the path else p = NULL; diff --git a/src/testdir/test_cd.vim b/src/testdir/test_cd.vim index 9b74d8fdca..e95c7c2e0e 100644 --- a/src/testdir/test_cd.vim +++ b/src/testdir/test_cd.vim @@ -409,4 +409,15 @@ func Test_cd_symlinks() call chdir(savedir) endfunc +func Test_cd_shorten_bufname_with_duplicate_slashes() + let savedir = getcwd() + call mkdir('Xexistingdir', 'R') + new Xexistingdir//foo/bar + cd Xexistingdir + call assert_equal('foo/bar', bufname('%')) + + call chdir(savedir) + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 8fabd64ed3..394a536da0 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 20, /**/ 19, /**/