shithub: werc

Download patch

ref: 736f21393a4a6baadd09993efe4774ae6786f6d1
parent: 2acc2442edefa684323d2021e1522e60a311c309
author: uriel <uriel@suckless.org>
date: Wed Jun 18 17:12:41 EDT 2008

Make .txt actually work

--- a/bin/controller.rc
+++ b/bin/controller.rc
@@ -95,10 +95,11 @@
     }
     if not if ( test -f $body.tpl )
         template.awk $body.tpl | rc $rcargs
-    if not if ( test -f $body.txt )
+    if not if ( test -f $body.txt ) {
         echo '<pre>'
-        cat $body.txt |fmt -j| sed 's/\</&gt;/' 's/\>/&lt;/'
+        cat $body.txt |fmt -l 82 -j | sed 's/</\&gt;/g; s/>/\&lt;/g'
         echo '</pre>'
+    }
     if not if ( test -f $body.html )
         cat $body.html | /bin/sed '0,/<[Bb][Oo][Dd][Yy][^>]*>/d; /<\/[Bb][Oo][Dd][Yy]>/,$d' 
     if not if (~ $body *.html && test -f $body )