aboutsummaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJohannes Sixt <johannes.sixt@telecom.at>2008-03-05 21:51:27 +0100
committerJohannes Sixt <johannes.sixt@telecom.at>2008-06-23 13:30:22 +0200
commit25fe217b86ca40c53e710d776e120dfa0d81f60b (patch)
tree17d027b37da265e44e48bf01f872cf20c1e6d931 /git-compat-util.h
parent4cd148d83f852363363e921c4925e67601654ff6 (diff)
downloadgit-25fe217b86ca40c53e710d776e120dfa0d81f60b.tar.gz
git-25fe217b86ca40c53e710d776e120dfa0d81f60b.tar.xz
Windows: Treat Windows style path names.
GIT's guts work with a forward slash as a path separators. We do not change that. Rather we make sure that only "normalized" paths enter the depths of the machinery. We have to translate backslashes to forward slashes in the prefix and in command line arguments. Fortunately, all of them are passed through functions in setup.c. A macro has_dos_drive_path() is defined that checks whether a path begins with a drive letter+colon combination. This predicate is always false on Unix. Another macro is_dir_sep() abstracts that a backslash is also a directory separator on Windows. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 9dc733e56..ab762c79e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -114,6 +114,14 @@
#define PATH_SEP ':'
#endif
+#ifndef has_dos_drive_prefix
+#define has_dos_drive_prefix(path) 0
+#endif
+
+#ifndef is_dir_sep
+#define is_dir_sep(c) ((c) == '/')
+#endif
+
#ifdef __GNUC__
#define NORETURN __attribute__((__noreturn__))
#else