At line /rc/bin/rc-httpd/rc-httpd:77 the variable `location` is computed as follows: … location=`{echo $REQUEST_URI | sed 's;\?.*;;'} location=`{echo $location | sed ' s;[^/]+/\.\./;/;g s;/\./;/;g s;//+;/;g '} … Does anyone know why `sed` is used twice to derive the variable `location`? In other words, why isn't `location` computed using a single invocation of `sed` like this: … location=`{echo $REQUEST_URI | sed ' s;\?.*;; s;[^/]+/\.\./;/;g s;/\./;/;g s;//+;/;g '} … The result should be the same, or am I missing something? The advantage of this change is one less invocation of `sed` for each http request. Here an the git/importable patch: From: Igor Böhm Date: Fri, 29 Oct 2021 22:59:06 +0000 Subject: [PATCH] rc-httpd: fold two sed calls into one when computing location --- diff ee31c7808087c24b268bb5700b6d695c1bae0cd8 76990597f21f5ec3972403e8afbc18dba80ddabe --- a/rc/bin/rc-httpd/rc-httpd Mon Oct 18 01:35:37 2021 +++ b/rc/bin/rc-httpd/rc-httpd Sat Oct 30 00:59:06 2021 @@ -74,8 +74,8 @@ } QUERY_STRING=`{echo $REQUEST_URI | sed 's;[^?]*\??;;'} params=`{echo $QUERY_STRING | sed 's;\+; ;g'} -location=`{echo $REQUEST_URI | sed 's;\?.*;;'} -location=`{echo $location | sed ' +location=`{echo $REQUEST_URI | sed ' + s;\?.*;; s;[^/]+/\.\./;/;g s;/\./;/;g s;//+;/;g Cheers, Igor