Bug 2322 – Wrong behavior of std.path.dirname() in Windows

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-08-29T23:51:00Z
Last change time
2015-06-09T01:20:08Z
Assigned to
bugzilla
Creator
snake.scaly

Comments

Comment #0 by snake.scaly — 2008-08-29T23:51:45Z
Windows version of dirname() sometimes gives incorrect results: dirname(r"\foo") -> "." The "\foo" path is relative to the root of the current drive. The correct dirname for "\foo" is "\" which is the root of the current drive. dirname(r"c:\foo") -> "c:" Windows maintains separate working directories for each drive. "c:" refers to a working directory for drive "C". The correct dirname for "c:\foo" is "c:\" which is the root of drive "C".
Comment #1 by bartosz — 2008-08-30T14:35:16Z
Fixed in revision 842. Added the two cases to unittest.