March 12, 2010 [Issue 3937] New: os.path.dirname fails on absolute path | ||||
---|---|---|---|---|
| ||||
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: nobody@puremagic.com ReportedBy: ellery-newcomer@utulsa.edu --- Comment #0 from Ellery Newcomer <ellery-newcomer@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: ------- |
June 24, 2010 [Issue 3937] os.path.dirname fails on absolute path | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | http://d.puremagic.com/issues/show_bug.cgi?id=3937 Shin Fujishiro <rsinfu@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #1 from Shin Fujishiro <rsinfu@gmail.com> 2010-06-23 21:19:32 PDT --- Fixed in svn r1692. The fix will be included in release 2.048. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation