зеркало из https://github.com/microsoft/git.git
dir_inside_of(): handle directory separators correctly
On Windows, both the forward slash and the backslash are directory separators. Which means that `a\b\c` really is inside `a/b`. Therefore, we need to special-case the directory separators in the helper function `cmp_icase()` that is used in the loop in `dir_inside_of()`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Родитель
2c3e5ea26e
Коммит
2e7edbbab1
2
dir.c
2
dir.c
|
@ -3140,6 +3140,8 @@ static int cmp_icase(char a, char b)
|
|||
{
|
||||
if (a == b)
|
||||
return 0;
|
||||
if (is_dir_sep(a))
|
||||
return is_dir_sep(b) ? 0 : -1;
|
||||
if (ignore_case)
|
||||
return toupper(a) - toupper(b);
|
||||
return a - b;
|
||||
|
|
Загрузка…
Ссылка в новой задаче