Bug 10347 – buildPath returns relative path when joining absolute with relative path

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2013-06-12T17:39:00Z
Last change time
2013-08-06T23:32:12Z
Assigned to
bugzilla
Creator
andrej.mitrovich
Depends on
10348

Comments

Comment #0 by andrej.mitrovich — 2013-06-12T17:39:51Z
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'
Comment #1 by bugzilla — 2013-07-28T09:56:36Z
I have an improved implementation of buildPath() in the works. I'll ensure it behaves correctly for this case.
Comment #2 by bugzilla — 2013-07-30T11:55:51Z
Comment #3 by bugzilla — 2013-08-06T23:32:12Z