]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/urls/urls.factor
urls: handle a series of /././././ in paths.
[factor.git] / basis / urls / urls.factor
index 0347cd729295d9ef8dfc395df44a852453e3cac7..84a42f2d907e499f3de19d4a54d0319b0f3d1e4d 100644 (file)
@@ -147,7 +147,7 @@ M: url present
     ] "" make ;
 
 : remove-dot-segments ( path -- path' )
-    "/./" "/" replace
+    [ "/./" over subseq? ] [ "/./" "/" replace ] while
     [ "/../" split1 ] [ [ "/" split1-last drop ] dip "/" glue ] while*
     "/.." ?tail [ "/" split1-last drop "/" append ] when
     "../" ?head [ "/" prepend ] when