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.
This commit is contained in:
Johannes Sixt
2007-08-07 20:50:42 +02:00
parent 301ac806b7
commit 637fc51696

View File

@@ -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);