Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH 4/4] Util/helpfiles: prefer 'col -bx' over 'colcrt'



Even when given the '-' option colcrt removes any underscore
characters from the text, ending up with all words like
'CHASE_LINKS' being converted to 'CHASE LINKS'.

'col -bx' works fine in those cases. Since as of the lastest
changes both variants are tried, avaibility of the command on
different systems is not an issue and it is safe to prefer 'col'.
---
 Util/helpfiles | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Util/helpfiles b/Util/helpfiles
index 9909a1d..699ca83 100755
--- a/Util/helpfiles
+++ b/Util/helpfiles
@@ -67,17 +67,17 @@ if(system('man ' . $args) || !(-s $mantmp)) {
 }
 $args = "$mantmp >$coltmp";
 unlink($coltmp);
-&Info('attempting colcrt - ', $args);
-if(system('colcrt - ' . $args) || !(-s $coltmp)) {
-    unlink($coltmp);
-    &Info('attempting col -bx <', $args);
+&Info('attempting col -bx <', $args);
 # The x is necessary so that spaces don't turn into tabs, which messes
 # up the calculations of indentation on machines which randomly wrap lines
 # round to the previous line (so you see what we're up against).
-    if(system('col -bx <' . $args) || !(-s $coltmp)) {
+if(system('col -bx <' . $args) || !(-s $coltmp)) {
+    unlink($coltmp);
+    &Info('attempting colcrt - ', $args);
+    if(system('colcrt - ' . $args) || !(-s $coltmp)) {
         unlink($mantmp);
         unlink($coltmp);
-        &Die('colcrt and col -bx both failed');
+        &Die('col -bx and colcrt - both failed');
     }
 }
 unlink($mantmp) || &Die('cannot remove tempfile ', $mantmp);
-- 
1.9.0



Messages sorted by: Reverse Date, Date, Thread, Author