summaryrefslogtreecommitdiff
path: root/src/path.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/path.h')
-rw-r--r--src/path.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/path.h b/src/path.h
index 360372cfb..d674b1b94 100644
--- a/src/path.h
+++ b/src/path.h
@@ -105,6 +105,9 @@ GIT_INLINE(int) git_path_is_dot_or_dotdotW(const wchar_t *name)
(name[1] == L'.' && name[2] == L'\0')));
}
+#define git_path_is_absolute(p) \
+ (git__isalpha((p)[0]) && (p)[1] == ':' && ((p)[2] == '\\' || (p)[2] == '/'))
+
/**
* Convert backslashes in path to forward slashes.
*/
@@ -119,6 +122,10 @@ GIT_INLINE(void) git_path_mkposix(char *path)
}
#else
# define git_path_mkposix(p) /* blank */
+
+#define git_path_is_absolute(p) \
+ ((p)[0] == '/')
+
#endif
/**