Fix the run_tests script so that the number of columns is never 0.
authorMartin Schwenke <martin@meltin.net>
Fri, 3 Jul 2009 07:58:38 +0000 (17:58 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 7 Jul 2009 23:41:06 +0000 (09:41 +1000)
Sometimes "stty size" reports 0, for example when running in a shell
under Emacs.  In this case, we just change it to 80.

Signed-off-by: Martin Schwenke <martin@meltin.net>
tests/scripts/run_tests

index 8df1aecd257ed60fa123a3d3abda96a47262a792..8a878593521758b20c4eb133f7c5c868544cce88 100755 (executable)
@@ -40,7 +40,7 @@ tests_total=0
 tests_passed=0
 summary=""
 
-rows=$(if tty -s ; then stty size ; else echo x 80 ; fi | sed -e 's@.* @@')
+rows=$(if tty -s ; then stty size ; else echo x 80 ; fi | sed -e 's@.* @@' -e 's@^0$@80@')
 ww=$((rows - 7))
 
 for f; do