[Issue 10347] New: buildPath returns relative path when joining absolute with relative path
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jun 12 17:39:52 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10347
Summary: buildPath returns relative path when joining absolute
with relative path
Product: D
Version: D2
Platform: All
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-06-12 17:39:51 PDT ---
On Windows:
-----
import std.stdio;
import std.path;
void main()
{
string absolute = r"C:\";
string relative = r"\foo";
assert(isAbsolute(absolute));
assert(!isAbsolute(relative));
writeln(buildPath(absolute, relative)); // writes \foo
}
-----
Interestingly if you swap the arguments around you get back C:\.
Python does it properly:
>>> import os.path
>>> os.path.join("C:\\", "\\foo")
'C:\\foo'
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list