This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
RE: Re[2]: [PATCH] setup.exe: mkdir.cc. was: setup.exe crash
- From: "Robert Collins" <robert dot collins at itdomain dot com dot au>
- To: "Pavel Tsekov" <ptsekov at syntrex dot com>
- Cc: <cygwin-patches at cygwin dot com>
- Date: Tue, 26 Mar 2002 22:40:42 +1100
- Subject: RE: Re[2]: [PATCH] setup.exe: mkdir.cc. was: setup.exe crash
> -----Original Message-----
> From: Pavel Tsekov [mailto:ptsekov@syntrex.com]
> Sent: Tuesday, March 26, 2002 10:28 PM
> To: Robert Collins
> Cc: cygwin-patches@cygwin.com
> Subject: Re[2]: [PATCH] setup.exe: mkdir.cc. was: setup.exe crash
>
>
> Hello Robert,
>
> Tuesday, March 26, 2002, 12:10:09 PM, you wrote:
>
> RC> Pavel,
> RC> care to supply a changelog? Thanks for tracking this down
> RC> too.
>
> Of course! :) I didn't supply it the first time because I've
> sent the patch for review.
>
> Btw. I haven't checked if the new return value is a problem
> for any of the mkdir_p () callers.
Oh, it may well be, so I was going to checkin a variant anyway:
1 is failure :}.
Index: mkdir.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/mkdir.cc,v
retrieving revision 2.3
diff -u -p -r2.3 mkdir.cc
--- mkdir.cc 2001/11/13 01:49:32 2.3
+++ mkdir.cc 2002/03/26 11:40:10
@@ -69,6 +69,10 @@ mkdir_p (int isadir, const char *in_path
if (!slash)
return 0;
+ // Trying to create a drive... It's time to give up.
+ if (((slash - path) == 2) && (path[1] == ':'))
+ return 1;
+
saved_char = *slash;
*slash = 0;
if (mkdir_p (1, path))
@@ -76,6 +80,7 @@ mkdir_p (int isadir, const char *in_path
*slash = saved_char;
return 1;
}
+
*slash = saved_char;
if (!isadir)