~ chicken-core (chicken-5) ae2b9b68f01a912fac86154b96013da1c4041619
commit ae2b9b68f01a912fac86154b96013da1c4041619 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Sat Jun 18 15:20:58 2011 +0200 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Sat Jun 18 15:20:58 2011 +0200 fixed dropping of device name for windows flavor of normalize-pathname (reported by Jim) diff --git a/files.scm b/files.scm index a9c37e77..3830c819 100644 --- a/files.scm +++ b/files.scm @@ -361,9 +361,12 @@ EOF (when (fx> i prev) (set! parts (addpart (##sys#substring path prev i) parts))) (if (null? parts) - (if abspath - (##sys#string-append (string sep) ".") - (##sys#string-append "." (string sep)) ) + (let ((r (if abspath + (##sys#string-append (string sep) ".") + (##sys#string-append "." (string sep)) ))) + (if drive + (##sys#string-append drive r) + r)) (let ((out (open-output-string)) (parts (reverse parts))) (display (car parts) out) diff --git a/tests/path-tests.scm b/tests/path-tests.scm index 72975ea8..4611fc3b 100644 --- a/tests/path-tests.scm +++ b/tests/path-tests.scm @@ -50,6 +50,7 @@ (test "a/b" (normalize-pathname "a/b/c/d/../.." 'unix)) (test "a/b/" (normalize-pathname "a/b/c/d/../../" 'unix)) (test "../../foo" (normalize-pathname "../../foo" 'unix)) +(test "c:\\." (normalize-pathname "c:\\" 'windows)) (define home (get-environment-variable "HOME"))Trap