Merged DMD 1.042.

This commit is contained in:
Tomas Lindquist Olsen
2009-04-03 17:59:34 +02:00
parent 57bf95cb42
commit 3d1f8cc565
38 changed files with 6504 additions and 5232 deletions

View File

@@ -583,9 +583,17 @@ char *FileName::name(const char *str)
return e + 1;
#if _WIN32
case '/':
case '\\':
case ':':
return e + 1;
case ':':
/* The ':' is a drive letter only if it is the second
* character or the last character,
* otherwise it is an ADS (Alternate Data Stream) separator.
* Consider ADS separators as part of the file name.
*/
if (e == str + 1 || e == str + len - 1)
return e + 1;
#endif
default:
if (e == str)
@@ -620,7 +628,7 @@ char *FileName::path(const char *str)
n--;
#if _WIN32
if (n[-1] == '\\')
if (n[-1] == '\\' || n[-1] == '/')
n--;
#endif
}
@@ -822,8 +830,8 @@ void FileName::ensurePathExists(const char *path)
if (*p)
{
#if _WIN32
size_t len = strlen(p);
if (len > 2 && p[-1] == ':')
size_t len = strlen(path);
if (len > 2 && p[-1] == ':' && path + 2 == p)
{ mem.free(p);
return;
}