From 505d5fb960e1af7c78e7e589c729523c7da1c544 Mon Sep 17 00:00:00 2001 From: erw7 Date: Sat, 3 Aug 2019 14:54:21 +0900 Subject: Fix get_path_cutoff() on Windows Fix an issue where the result of get_path cutoff() was incorrect when using set shellslash. --- src/nvim/path.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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]; -- cgit