]> gitweb.factorcode.org Git - factor.git/commitdiff
urls: remove unnecessary slashes in remove-dot-segments.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 15 Mar 2021 19:56:07 +0000 (12:56 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 15 Mar 2021 19:56:07 +0000 (12:56 -0700)
basis/urls/urls.factor

index 73a772546acee3438c60f375bd4cb1324afab5df..813fe7e9afb1af17710fb2b8471e90ce88a92d1b 100644 (file)
@@ -147,6 +147,7 @@ M: url present
     ] "" make ;
 
 : remove-dot-segments ( path -- path' )
+    [ "//" split1 ] [ "/" glue ] while*
     [ "/./" split1 ] [ "/" glue ] while*
     [ "/../" split1 ] [ [ "/" split1-last drop ] dip "/" glue ] while*
     "/.." ?tail [ "/" split1-last drop "/" append ] when