mirror of
https://github.com/vim/vim.git
synced 2026-05-28 00:21:37 +02:00
patch 9.2.0020: Wrong shortened buffer after :cd with duplicate slashes
Problem: Wrong shortened buffer name after :cd with duplicate slashes. Solution: Skip over multiple consecutive path separators (zeertzjq). related: neovim/neovim#37080 closes: #19444 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
06a604dc8e
commit
f245e17ac7
+3
-1
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -734,6 +734,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
20,
|
||||
/**/
|
||||
19,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user