diff options
Diffstat (limited to 'libbb/make_directory.c')
-rw-r--r-- | libbb/make_directory.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libbb/make_directory.c b/libbb/make_directory.c index 9b03bb8d0..e0fd486d8 100644 --- a/libbb/make_directory.c +++ b/libbb/make_directory.c | |||
@@ -49,11 +49,19 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags) | |||
49 | } | 49 | } |
50 | 50 | ||
51 | org_mask = cur_mask = (mode_t)-1L; | 51 | org_mask = cur_mask = (mode_t)-1L; |
52 | #if ENABLE_PLATFORM_MINGW32 | ||
53 | /* normalise path separators, path is already assumed writable */ | ||
54 | bs_to_slash(path); | ||
55 | #endif | ||
52 | s = path; | 56 | s = path; |
53 | while (1) { | 57 | while (1) { |
54 | c = '\0'; | 58 | c = '\0'; |
55 | 59 | ||
56 | if (flags & FILEUTILS_RECUR) { /* Get the parent */ | 60 | if (flags & FILEUTILS_RECUR) { /* Get the parent */ |
61 | #if ENABLE_PLATFORM_MINGW32 | ||
62 | if (s == path) | ||
63 | s += root_len(path); | ||
64 | #endif | ||
57 | /* Bypass leading non-'/'s and then subsequent '/'s */ | 65 | /* Bypass leading non-'/'s and then subsequent '/'s */ |
58 | while (*s) { | 66 | while (*s) { |
59 | if (*s == '/') { | 67 | if (*s == '/') { |