From 637fc51696dc067c006b1651689b2f0aac26ec04 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 7 Aug 2007 20:50:42 +0200 Subject: [PATCH] Implement is_absolute_path() on Windows. To keep the brief, we don't check that there must be a letter before the colon and a slash or backslash after the colon - we just assume that we don't have to work with drive-relative paths. --- cache.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cache.h b/cache.h index d9598bb685..a701139fd8 100644 --- a/cache.h +++ b/cache.h @@ -364,7 +364,11 @@ int safe_create_leading_directories(char *path); char *enter_repo(char *path, int strict); static inline int is_absolute_path(const char *path) { +#ifndef __MINGW32__ return path[0] == '/'; +#else + return path[0] == '/' || (path[0] && path[1] == ':'); +#endif } const char *make_absolute_path(const char *path);