Fix get_path_cutoff() on Windows

Fix an issue where the result of get_path cutoff() was incorrect when
using set shellslash.
This commit is contained in:
erw7 2019-08-03 14:54:21 +09:00
parent d7b642cadb
commit 505d5fb960

View File

@ -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];