Fix bug: pathname directories can contain the symbol 'UP, but the
authorChris Hanson <org/chris-hanson/cph>
Thu, 9 Mar 2006 05:29:28 +0000 (05:29 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 9 Mar 2006 05:29:28 +0000 (05:29 +0000)
pathname/URI conversions weren't handling that case.

v7/src/runtime/pathnm.scm

index 271ccfe35d686514cea9c7d51fb1bc48dc44e33a..28152fe1e2e30f769c58f5604efc0590b826f368 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: pathnm.scm,v 14.46 2006/03/07 20:29:34 cph Exp $
+$Id: pathnm.scm,v 14.47 2006/03/09 05:29:28 cph Exp $
 
 Copyright 1987,1988,1989,1990,1991,1992 Massachusetts Institute of Technology
 Copyright 1993,1994,1995,1996,2000,2001 Massachusetts Institute of Technology
@@ -304,9 +304,9 @@ these rules:
     (make-uri (if (pathname-absolute? pathname) 'file #f)
              #f
              (map (lambda (x)
-                    (if (eq? x 'WILD)
-                        "*"
-                        (string->utf8-string x)))
+                    (cond ((eq? x 'WILD) "*")
+                          ((eq? x 'UP) "..")
+                          (else (string->utf8-string x))))
                   (append (if (pathname-absolute? pathname)
                               (list "")
                               '())
@@ -346,9 +346,9 @@ these rules:
     (let ((scheme (uri-scheme uri))
          (path
           (map (lambda (x)
-                 (if (string=? x "*")
-                     'WILD
-                     (utf8-string->string x)))
+                 (cond ((string=? x "*") 'WILD)
+                       ((string=? x "..") 'UP)
+                       (else (utf8-string->string x))))
                (uri-path uri)))
          (lose
           (lambda ()