shithub: plan9front

Download patch

ref: 07f858472356480206c056ae0c0ecf6431a73ae2
parent: 498d86b9218287b2b5c16aa54a283249fbd4e5a3
author: Igor Böhm <igor@9lab.org>
date: Fri Oct 29 18:59:06 EDT 2021

rc-httpd: fold two sed calls into one when computing location

--- a/rc/bin/rc-httpd/rc-httpd	Mon Nov  1 12:31:39 2021
+++ b/rc/bin/rc-httpd/rc-httpd	Fri Oct 29 18: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