http://d.puremagic.com/issues/show_bug.cgi?id=3937
Summary: os.path.dirname fails on absolute path Product: D Version: 2.040 Platform: Other OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: ellery-newco...@utulsa.edu --- Comment #0 from Ellery Newcomer <ellery-newco...@utulsa.edu> 2010-03-12 12:45:01 PST --- According to DDoc, assert(dirname(dirname("/home/user")) == ""); however, that assert isn't in the unittest, and the actual result is ".". I would prefer "/" to either result. suggested fix: --- path.d (revision 1452) +++ path.d (working copy) @@ -359,7 +359,7 @@ * version(Posix) * { * assert(dirname("/home/user") == "/home"); - * assert(dirname(dirname("/home/user")) == ""); + * assert(dirname(dirname("/home/user")) == "/"); * } * ----- */ @@ -386,7 +386,7 @@ version(Posix) { if (fullname[i - 1] == sep[0]) - { i--; + { if(i > 1) i--; break; } } @@ -401,6 +401,7 @@ version (Posix) { assert(dirname("/path/to/file") == "/path/to"); + assert(dirname(dirname("/home/user")) == "/"); } else { -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------