vim-patch:9.2.0020: Wrong shortened buffer after :cd with duplicate slashes (#37955)

Problem:  Wrong shortened buffer name after :cd with duplicate slashes.
Solution: Skip over multiple consecutive path separators (zeertzjq).

related: neovim/neovim#37080
closes:  vim/vim#19444

f245e17ac7

N/A patches:
vim-patch:9.0.1859: heap-use-after-free in bt_normal()
vim-patch:9.2.0022: bt_quickfix() is slow
This commit is contained in:
zeertzjq
2026-02-19 07:46:10 +08:00
committed by GitHub
parent d74e927310
commit ac84a3f3b6
3 changed files with 20 additions and 1 deletions

View File

@@ -299,6 +299,11 @@ describe('path.c', function()
local full = to_cstr('some/very/long/directory/file.txt')
local dir = to_cstr('some/very/long')
eq('directory/file.txt', (ffi.string(cimp.path_shorten_fname(full, dir))))
-- Also works with duplicate slashes. #37080
full = to_cstr('some/very/long//directory/file.txt')
eq('directory/file.txt', (ffi.string(cimp.path_shorten_fname(full, dir))))
full = to_cstr('some/very/long///directory/file.txt')
eq('directory/file.txt', (ffi.string(cimp.path_shorten_fname(full, dir))))
end)
end)
end)