mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-28 05:46:45 -05:00
Refactor skipping DOS drive prefixes
Junio Hamano pointed out that there is an implicit assumption in pretty much all the code calling has_dos_drive_prefix(): it assumes that the DOS drive prefix is always two bytes long. While this assumption is pretty safe, we can still make the code more readable and less error-prone by introducing a function that skips the DOS drive prefix safely. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -335,6 +335,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(const 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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user