diff options
author | Ron Yorston <rmy@pobox.com> | 2021-10-12 09:06:35 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-10-12 09:06:35 +0100 |
commit | 0d127fbf4bbcd09f36740019ef129851464f8660 (patch) | |
tree | 02ecc3b3749d3b5f8776cdfe92c7219a92785d47 /win32 | |
parent | e19dd7d618434be1336727a5113c1432ac3c6573 (diff) | |
download | busybox-w32-0d127fbf4bbcd09f36740019ef129851464f8660.tar.gz busybox-w32-0d127fbf4bbcd09f36740019ef129851464f8660.tar.bz2 busybox-w32-0d127fbf4bbcd09f36740019ef129851464f8660.zip |
win32: use is_dir_sep() everywhere
The is_dir_sep() macro, which has been around since the start of
busybox-w32, can be used instead of is_path_sep().
Diffstat (limited to 'win32')
-rw-r--r-- | win32/mingw.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index b8dd6a511..f4ae60d41 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -1874,9 +1874,8 @@ void hide_console(void) | |||
1874 | } | 1874 | } |
1875 | #endif | 1875 | #endif |
1876 | 1876 | ||
1877 | #define is_path_sep(x) ((x) == '/' || (x) == '\\') | 1877 | #define is_unc_path(x) (strlen(x) > 4 && is_dir_sep(x[0]) && \ |
1878 | #define is_unc_path(x) (strlen(x) > 4 && is_path_sep(x[0]) && \ | 1878 | is_dir_sep(x[1]) && !is_dir_sep(x[2])) |
1879 | is_path_sep(x[1]) && !is_path_sep(x[2])) | ||
1880 | 1879 | ||
1881 | /* Return the length of the root of a UNC path, i.e. the '//host/share' | 1880 | /* Return the length of the root of a UNC path, i.e. the '//host/share' |
1882 | * component, or 0 if the path doesn't look like that. */ | 1881 | * component, or 0 if the path doesn't look like that. */ |
@@ -2009,7 +2008,7 @@ void fix_path_case(char *path) | |||
2009 | *path = toupper(*path); | 2008 | *path = toupper(*path); |
2010 | } | 2009 | } |
2011 | else if (len != 0) { | 2010 | else if (len != 0) { |
2012 | for (path+=2; !is_path_sep(*path); ++path) { | 2011 | for (path+=2; !is_dir_sep(*path); ++path) { |
2013 | *path = toupper(*path); | 2012 | *path = toupper(*path); |
2014 | } | 2013 | } |
2015 | } | 2014 | } |