~ chicken-core (chicken-5) 658955c86d2e7083e6184246f77088cfb354152c
commit 658955c86d2e7083e6184246f77088cfb354152c 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 17:08:49 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 5496e949..63501674 100644 --- a/files.scm +++ b/files.scm @@ -368,9 +368,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 a1d5ee64..9bb90d7e 100644 --- a/tests/path-tests.scm +++ b/tests/path-tests.scm @@ -54,6 +54,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