shithub: werc

Download patch

ref: fd90772d14549e2efb42ab046b30f6e971f9d39b
parent: 0e8cdf69637e1b8b514c985e2589d02e1d0cb1ce
author: kris <kris@engel.se.cat-v.org>
date: Mon Jun 4 02:34:33 EDT 2007

Fix sed snafu.

--- a/bin/controller.rc
+++ b/bin/controller.rc
@@ -25,7 +25,7 @@
     echo '<h1 class="headerTitle"><a href="/">' ^ $"siteTitle ^ '<span id="headerSubTitle">' ^ $"siteSubTitle ^ '</span></a></h1>'
 }
 
-dirfilter = '/\/./d; /\/_[^\/]*$/d; s,^\./,,; s,\.md$,,;'
+dirfilter = '/\/\./d; /\/_[^\/]*$/d; s,^\./,,; s,\.md$,,;'
 
 # Sidebar 
 fn menu {
@@ -34,7 +34,6 @@
     END { print "</ul>" }
     /^([a-zA-Z0-9+_\-]+[\/*]?)+$/ && $NF != "index" {
         isdir = match($0, "/$")
-
         sub("[*/]$", "")
 
         bname = $0
@@ -124,18 +123,6 @@
 if (test -d $body)
     body=$body/index
 
-fn template {
-    template.awk | rc |
-    awk '{
-        buf = buf $0"\n"
-        if(length(buf) > 8192) {
-            printf "%s", buf
-            buf = ""
-        }
-    }
-    END{ printf "%s", buf }'
-}
-
 # RSS
 fn statpost {
 	f = $1
@@ -155,6 +142,18 @@
 			print
 		}' $f | sed 's/\]\]>/Fucking goddamn XML garbage/g'}
 	}
+}
+
+fn template {
+    template.awk | rc |
+    awk '{
+        buf = buf $0"\n"
+        if(length(buf) > 8192) {
+            printf "%s", buf
+            buf = ""
+        }
+    }
+    END{ printf "%s", buf }'
 }
 
 if(! ~ $REQUEST_URI */index.rss) {