Merge branch 'js/rebase-r-strategy'
[git/debian.git] / compat / win32 / path-utils.h
blob0f70d439204fbe1336dcea51c43a38498e69de96
1 #define has_dos_drive_prefix(path) \
2 (isalpha(*(path)) && (path)[1] == ':' ? 2 : 0)
3 int win32_skip_dos_drive_prefix(char **path);
4 #define skip_dos_drive_prefix win32_skip_dos_drive_prefix
5 static inline int win32_is_dir_sep(int c)
7 return c == '/' || c == '\\';
9 #define is_dir_sep win32_is_dir_sep
10 static inline char *win32_find_last_dir_sep(const char *path)
12 char *ret = NULL;
13 for (; *path; ++path)
14 if (is_dir_sep(*path))
15 ret = (char *)path;
16 return ret;
18 #define find_last_dir_sep win32_find_last_dir_sep
19 int win32_offset_1st_component(const char *path);
20 #define offset_1st_component win32_offset_1st_component