aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2019-08-03 14:54:21 +0900
committererw7 <erw7.github@gmail.com>2019-08-17 12:29:09 +0900
commit505d5fb960e1af7c78e7e589c729523c7da1c544 (patch)
tree0dec9bd4e1f0560b1ff51eb9b74f7faf4ffddcbe
parentd7b642cadb0bda7780539f6eb2f27ac5283821ab (diff)
downloadrneovim-505d5fb960e1af7c78e7e589c729523c7da1c544.tar.gz
rneovim-505d5fb960e1af7c78e7e589c729523c7da1c544.tar.bz2
rneovim-505d5fb960e1af7c78e7e589c729523c7da1c544.zip
Fix get_path_cutoff() on Windows
Fix an issue where the result of get_path cutoff() was incorrect when using set shellslash.
-rw-r--r--src/nvim/path.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 75a26d88c1..a58d57d566 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -852,8 +852,13 @@ static char_u *get_path_cutoff(char_u *fname, garray_T *gap)
int j = 0;
while ((fname[j] == path_part[i][j]
- ) && fname[j] != NUL && path_part[i][j] != NUL)
+#ifdef WIN32
+ || (vim_ispathsep(fname[j]) && vim_ispathsep(path_part[i][j]))
+#endif
+ ) // NOLINT(whitespace/parens)
+ && fname[j] != NUL && path_part[i][j] != NUL) {
j++;
+ }
if (j > maxlen) {
maxlen = j;
cutoff = &fname[j];