summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-06-30 00:09:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-06-30 00:09:17 (GMT)
commit033c2dc4364042b9e6dbd44e82e1974f78a72567 (patch)
tree8a7dc969376cd254dd46e5f4038f9592929f8a7a /compat
parent1fd7ef2e8f6b8b67f4d3be7b9ab5bbd9d8f639ec (diff)
parente0f530ff8afbd252170f57e70a8609a83a7cabe1 (diff)
downloadgit-033c2dc4364042b9e6dbd44e82e1974f78a72567.zip
git-033c2dc4364042b9e6dbd44e82e1974f78a72567.tar.gz
git-033c2dc4364042b9e6dbd44e82e1974f78a72567.tar.bz2
Merge branch 'ef/maint-win-verify-path'
* ef/maint-win-verify-path: verify_dotfile(): do not assume '/' is the path seperator verify_path(): simplify check at the directory boundary verify_path: consider dos drive prefix real_path: do not assume '/' is the path seperator A Windows path starting with a backslash is absolute
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/compat/mingw.h b/compat/mingw.h
index 547568b..ce9dd98 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -300,6 +300,15 @@ int winansi_fprintf(FILE *stream, const char *format, ...) __attribute__((format
#define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':')
#define is_dir_sep(c) ((c) == '/' || (c) == '\\')
+static inline char *mingw_find_last_dir_sep(const char *path)
+{
+ char *ret = NULL;
+ for (; *path; ++path)
+ if (is_dir_sep(*path))
+ ret = (char *)path;
+ return ret;
+}
+#define find_last_dir_sep mingw_find_last_dir_sep
#define PATH_SEP ';'
#define PRIuMAX "I64u"