mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01:00
Path combining on Windows didn't work with / properly.
This commit is contained in:
13
dmd/root.c
13
dmd/root.c
@@ -324,17 +324,16 @@ char *FileName::combine(char *path, char *name)
|
||||
f = (char *)mem.malloc(pathlen + 1 + namelen + 1);
|
||||
memcpy(f, path, pathlen);
|
||||
|
||||
if (path[pathlen - 1] != '/')
|
||||
if (
|
||||
path[pathlen - 1] != '/'
|
||||
#if _WIN32
|
||||
&& path[pathlen - 1] != '\\' && path[pathlen - 1] != ':'
|
||||
#endif
|
||||
)
|
||||
{ f[pathlen] = '/';
|
||||
pathlen++;
|
||||
}
|
||||
|
||||
#if _WIN32
|
||||
if (path[pathlen - 1] != '\\' && path[pathlen - 1] != ':')
|
||||
{ f[pathlen] = '\\';
|
||||
pathlen++;
|
||||
}
|
||||
#endif
|
||||
memcpy(f + pathlen, name, namelen + 1);
|
||||
return f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user