www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10347] New: buildPath returns relative path when joining absolute with relative path

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich 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: -------
Jun 12 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10347


Lars T. Kyllingstad <bugzilla kyllingen.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |bugzilla kyllingen.net
         AssignedTo|nobody puremagic.com        |bugzilla kyllingen.net


--- Comment #1 from Lars T. Kyllingstad <bugzilla kyllingen.net> 2013-07-28
09:56:36 PDT ---
I have an improved implementation of buildPath() in the works.  I'll ensure it
behaves correctly for this case.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 28 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10347



--- Comment #2 from Lars T. Kyllingstad <bugzilla kyllingen.net> 2013-07-30
11:55:51 PDT ---
Pull request: https://github.com/D-Programming-Language/phobos/pull/1442

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 30 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10347


Lars T. Kyllingstad <bugzilla kyllingen.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


--- Comment #3 from Lars T. Kyllingstad <bugzilla kyllingen.net> 2013-08-06
23:32:12 PDT ---
https://github.com/D-Programming-Language/phobos/commit/d19dcfa7ef95f5bfa2376b931bf517ec139fe6cd

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 06 2013