]> gitweb.factorcode.org Git - factor.git/commitdiff
urls: use split1 instead of replace in remove-dot-segments.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 15 Mar 2021 18:53:01 +0000 (11:53 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 15 Mar 2021 18:53:01 +0000 (11:53 -0700)
basis/urls/urls.factor

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