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>
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user