]> git.plutz.net Git - busy/commitdiff
further optimization of parameter parsing
authorpaul <paul@plutz.net>
Thu, 29 Mar 2012 01:32:30 +0000 (01:32 +0000)
committerpaul <paul@plutz.net>
Thu, 29 Mar 2012 01:32:30 +0000 (01:32 +0000)
svn path=/trunk/; revision=41

Subversion.page

index adc89b8016da400ef5ef4e623781f226f7db4a52..6592ddbaaaebde735e40649487519a2f67420ae6 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/zsh
 url="$(sed -rn 's:\+: :g;s:%:\\x:g;s:^(.*&)?i=([^&]+)(&.*)?$:\2:p' <<<"${QUERY_STRING}")"
 url="$(echo -e "${url}" |sed -rn '1{s:\t: :g;s:\r::g;s:\\:\\\\:g;p}')"
-rev="$(sed -rn '/^(.*&)?r=([0-9]+)(&.*)?$/{s:^(.*&)?r=([0-9]+)(&.*)?$:\2:;s:\+: :g;s:%:\\x:g;p}' <<<"${QUERY_STRING}")"
+rev="$(sed -rn 's:\+: :g;s:%:\\x:g;s:^(.*&)?r=([0-9]+)(&.*)?$:\2:p' <<<"${QUERY_STRING}")"
+#rev="$(sed -rn '/^(.*&)?r=([0-9]+)(&.*)?$/{s:^(.*&)?r=([0-9]+)(&.*)?$:\2:;s:\+: :g;s:%:\\x:g;p}' <<<"${QUERY_STRING}")"
 
 baseuri=$(sed -rn 's:^svnRepo=(.*)$:\1:p' project.meta)
 lastrev=$(svn info "$baseuri" |sed -rn 's;^Revision: *([0-9]+);\1;p')
@@ -16,7 +17,7 @@ cat <<SVNEND
       echo "<a href='?p=Subversion&amp;i=$tmp&amp;r=$rev'>/$(basename "$tmp")</a> "
       tmp=$(dirname "$tmp")/
     done |tac)
-    <hr><!---------------------------------------------------------------------------------->
+    <hr><!----------------------------------------------->
     <h1>Revisions:</h1>
     $(for i in {1.."$lastrev"}; do
       echo "<a href='?p=Subversion&amp;i=$url&amp;r=$i'>$i</a>"