Revert pull request #2537 to fix git-head regression issue 13498

This reverts commit 875f2fe031, reversing
changes made to f5c7e97f2b.

The changed absolutePath code essentially cannot work because the buildPath() result is not implicitly convertible to inout(char)[], but it was accidentally accepted by the regression 13498.
This commit is contained in:
k-hara 2014-09-20 23:47:31 +09:00
parent 2ad0698308
commit 4b632bcfb1

View file

@ -1986,16 +1986,17 @@ unittest
Throws:
$(D Exception) if the specified _base directory is not absolute.
*/
inout(char)[] absolutePath(inout(char)[] path, lazy const(char)[] base = getcwd())
string absolutePath(string path, lazy string base = getcwd())
@safe pure
{
if (path.empty) return null;
if (isAbsolute(path)) return path;
const baseVar = base;
immutable baseVar = base;
if (!isAbsolute(baseVar)) throw new Exception("Base directory must be absolute");
return buildPath(baseVar, path);
}
unittest
{
version (Posix)
@ -2020,13 +2021,7 @@ unittest
assertThrown(absolutePath("bar", "foo"));
}
unittest
{
// Issue 12083
char[] path = ".".dup;
auto abs = path.absolutePath;
assert(abs == getcwd() ~ dirSeparator ~ ".");
}
/** Translates $(D path) into a relative _path.