diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-02-03 14:16:06 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-03 14:16:06 -0800 |
commit | e01c6b15c97e30baedc45021e6dcbd90140616cd (patch) | |
tree | ef740ad7bbef152f294149f3ad10f95de0919025 /git-compat-util.h | |
parent | ebcdd635c58e89dbf931a9f90a1b248fb5e90315 (diff) | |
parent | e7d5ce816579723150c341116737fb51d8e33eb3 (diff) | |
download | git-e01c6b15c97e30baedc45021e6dcbd90140616cd.tar.gz |
Merge branch 'js/dirname-basename'
dirname() emulation has been added, as Msys2 lacks it.
* js/dirname-basename:
mingw: avoid linking to the C library's isalpha()
t0060: loosen overly strict expectations
t0060: verify that basename() and dirname() work as expected
compat/basename.c: provide a dirname() compatibility function
compat/basename: make basename() conform to POSIX
Refactor skipping DOS drive prefixes
Diffstat (limited to 'git-compat-util.h')
-rw-r--r-- | git-compat-util.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index e8f2867228..693a336ff5 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -253,6 +253,8 @@ struct itimerval { #else #define basename gitbasename extern char *gitbasename(char *); +#define dirname gitdirname +extern char *gitdirname(char *); #endif #ifndef NO_ICONV @@ -335,6 +337,14 @@ static inline int git_has_dos_drive_prefix(const char *path) #define has_dos_drive_prefix git_has_dos_drive_prefix #endif +#ifndef skip_dos_drive_prefix +static inline int git_skip_dos_drive_prefix(char **path) +{ + return 0; +} +#define skip_dos_drive_prefix git_skip_dos_drive_prefix +#endif + #ifndef is_dir_sep static inline int git_is_dir_sep(int c) { |