summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorTheo Niessink <theo@taletn.com>2011-05-27 18:00:38 +0200
committerJunio C Hamano <gitster@pobox.com>2011-05-27 10:59:13 -0700
commit88135203af9df27c0f9c76c27bbbf48833bb31c8 (patch)
treef2039ac00ca627f064bb84a1abcf48e358683e22 /cache.h
parentbac9c06ba093d9254cb2ab3eed074722a3e635a6 (diff)
downloadgit-88135203af9df27c0f9c76c27bbbf48833bb31c8.tar.gz
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>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/cache.h b/cache.h
index 5e9675d76d..9d3d92cf9e 100644
--- a/cache.h
+++ b/cache.h
@@ -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);