From: lordhavoc Date: Wed, 20 Mar 2002 17:31:29 +0000 (+0000) Subject: fix for CreatePath creating a directory of the drive's letter in windows (d:\quake... X-Git-Tag: RELEASE_0_2_0_RC1~564 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8ca31ebb0a9198202fddbe788fca22a687e25883;p=xonotic%2Fdarkplaces.git fix for CreatePath creating a directory of the drive's letter in windows (d:\quake created a d directory, then d: (ignored), then d:\quake, now creates d: (ignored), then d:\quake) (thanks Elric) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1663 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/common.c b/common.c index bc7cfea3..eda4f717 100644 --- a/common.c +++ b/common.c @@ -841,8 +841,8 @@ void COM_StripExtension (char *in, char *out) while (*in) { if (*in == '.') - last = in; - if ((*in == '/') || (*in == '\\') || (*in == ':')) + last = out; + else if (*in == '/' || *in == '\\' || *in == ':') last = NULL; *out++ = *in++; } @@ -1355,8 +1355,9 @@ void COM_CreatePath (char *path) for (ofs = path+1 ; *ofs ; ofs++) { - if (*ofs == '/' || *ofs == '\\' || *ofs == ':') - { // create the directory + if (*ofs == '/' || *ofs == '\\') + { + // create the directory save = *ofs; *ofs = 0; Sys_mkdir (path);