From d90250d75cd624a6dc0156f98952ff418379948a Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 22 Apr 2009 22:27:24 +1000 Subject: libbb/bb_make_directory() recognize Windows drives as root directories --- libbb/make_directory.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libbb') diff --git a/libbb/make_directory.c b/libbb/make_directory.c index 9d7323129..db4609e84 100644 --- a/libbb/make_directory.c +++ b/libbb/make_directory.c @@ -60,6 +60,14 @@ int bb_make_directory (char *path, long mode, int flags) c = 0; if (flags & FILEUTILS_RECUR) { /* Get the parent. */ +#ifdef __MINGW32__ + /* skip drive letter and initial slashes */ + if (s == path && *s && s[1] == ':') { + s += 2; + while (*s == '/') + s++; + } +#endif /* Bypass leading non-'/'s and then subsequent '/'s. */ while (*s) { if (*s == '/') { -- cgit v1.2.3-55-g6feb