Skip to content

Commit

Permalink
A Windows path starting with a backslash is absolute
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Theo Niessink authored and Junio C Hamano committed May 27, 2011
1 parent bac9c06 commit 8813520
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ extern char *expand_user_path(const char *path);
char *enter_repo(char *path, int strict);
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 *);
const char *make_absolute_path(const char *path);
Expand Down

0 comments on commit 8813520

Please sign in to comment.