summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-05 22:54:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-05 22:54:17 (GMT)
commit07be1da216debe1f76cd4d03ac5effcb9e40e6c6 (patch)
tree7642a42d6b7348710a13374c6b6dda1b6a51d225 /git-compat-util.h
parent081363dde231346c2f051cd7d41622f6fa02e3cb (diff)
parente7d5ce816579723150c341116737fb51d8e33eb3 (diff)
downloadgit-07be1da216debe1f76cd4d03ac5effcb9e40e6c6.zip
git-07be1da216debe1f76cd4d03ac5effcb9e40e6c6.tar.gz
git-07be1da216debe1f76cd4d03ac5effcb9e40e6c6.tar.bz2
Merge branch 'js/dirname-basename' into maint
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.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index e8f2867..693a336 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)
{