From cd4e4f49ab4f84f0258871d92afb204b077f2cc8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 4 Aug 2007 12:43:26 -0400 Subject: [PATCH] mkdir: don't try to create directory "C:" if absolute path is given --- box/libbb/make_directory.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/box/libbb/make_directory.c b/box/libbb/make_directory.c index b8da099013..b8470f4b0a 100644 --- a/box/libbb/make_directory.c +++ b/box/libbb/make_directory.c @@ -48,6 +48,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 == '/') { -- 2.11.4.GIT