зеркало из https://github.com/microsoft/git.git
Merge branch 'nd/maint-relative'
* nd/maint-relative: get_cwd_relative(): do not misinterpret root path
This commit is contained in:
Коммит
20cb8e2025
6
dir.c
6
dir.c
|
@ -1033,6 +1033,12 @@ char *get_relative_cwd(char *buffer, int size, const char *dir)
|
|||
case '/':
|
||||
return cwd + 1;
|
||||
default:
|
||||
/*
|
||||
* dir can end with a path separator when it's root
|
||||
* directory. Return proper prefix in that case.
|
||||
*/
|
||||
if (dir[-1] == '/')
|
||||
return cwd;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче