aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-10-13 19:11:53 +0800
committerGitHub <noreply@github.com>2024-10-13 19:11:53 +0800
commit36890824c7edb7bc5458062c14efbfa0b1d280b5 (patch)
tree83d50aa726d6fa33ece54cab947101578bc68411 /src
parent2d24558c285198d2e725c83a8c4ad4d90797c950 (diff)
parent73309048cf160dc7a89242cacdf278448ae17e7b (diff)
downloadrneovim-36890824c7edb7bc5458062c14efbfa0b1d280b5.tar.gz
rneovim-36890824c7edb7bc5458062c14efbfa0b1d280b5.tar.bz2
rneovim-36890824c7edb7bc5458062c14efbfa0b1d280b5.zip
Merge pull request #30798 from zeertzjq/vim-8.2.0985
vim-patch:8.2.{0985,0986}: simplify() does not remove slashes from "///path"
Diffstat (limited to 'src')
-rw-r--r--src/nvim/path.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 4c16adde4c..80890acb7d 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -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 "/"