mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
vim-patch:8.2.0985: simplify() does not remove slashes from "///path"
Problem: Simplify() does not remove slashes from "///path".
Solution: Reduce > 2 slashes to one. (closes vim/vim#6263)
fdcbe3c3fe
Omit Test_readdirex() change: changed again in patch 9.0.0323.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -1538,6 +1538,13 @@ void simplify_filename(char *filename)
|
||||
} while (vim_ispathsep(*p));
|
||||
}
|
||||
char *start = p; // remember start after "c:/" or "/" or "///"
|
||||
#ifdef UNIX
|
||||
// Posix says that "//path" is unchanged but "///path" is "/path".
|
||||
if (start > filename + 2) {
|
||||
STRMOVE(filename + 1, p);
|
||||
start = p = filename + 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
do {
|
||||
// At this point "p" is pointing to the char following a single "/"
|
||||
|
Reference in New Issue
Block a user