A Windows path starting with a backslash is absolute
This fixes prefix_path() not recognizing e.g. \foo\bar as an absolute path on Windows. Signed-off-by: Theo Niessink <theo@taletn.com> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
bac9c06ba0
commit
88135203af
2
cache.h
2
cache.h
|
@ -715,7 +715,7 @@ extern char *expand_user_path(const char *path);
|
||||||
char *enter_repo(char *path, int strict);
|
char *enter_repo(char *path, int strict);
|
||||||
static inline int is_absolute_path(const char *path)
|
static inline int is_absolute_path(const char *path)
|
||||||
{
|
{
|
||||||
return path[0] == '/' || has_dos_drive_prefix(path);
|
return is_dir_sep(path[0]) || has_dos_drive_prefix(path);
|
||||||
}
|
}
|
||||||
int is_directory(const char *);
|
int is_directory(const char *);
|
||||||
const char *make_absolute_path(const char *path);
|
const char *make_absolute_path(const char *path);
|
||||||
|
|
Loading…
Reference in New Issue