mirror of
https://github.com/git/git.git
synced 2026-03-13 18:33:25 +01:00
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:
4
cache.h
4
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user