shithub: werc

Download patch

ref: 621e30862f40e32aee87577b3c9087d732fc9387
parent: b8f69136adcf58d6b0698ee6854ba4dfba38d1fe
author: uriel <[email protected]>
date: Wed Jun 18 17:27:08 EDT 2008

Make the output of fortunes.txt more readable and comment a couple of hacks/issues with .txt files.

--- a/bin/controller.rc
+++ b/bin/controller.rc
@@ -97,7 +97,9 @@
         template.awk $body.tpl | rc $rcargs
     if not if ( test -f $body.txt ) {
         echo '<pre>'
-        cat $body.txt |fmt -l 82 -j | sed 's/</\&gt;/g; s/>/\&lt;/g'
+	# XXX Insering a blank line between lines in input is good for fortunes.txt, but probably not for other .txt files
+	# XXX Words are not broken, even if they are way beyond 82 chars long
+        cat $body.txt |sed 's/$/\n/g; s/</\&gt;/g; s/>/\&lt;/g' |fmt -l 82 -j
         echo '</pre>'
     }
     if not if ( test -f $body.html )