sym-gtest: Don't include empty words.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 27 Dec 2008 14:26:02 +0000 (14:26 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 27 Dec 2008 14:28:36 +0000 (14:28 +0000)
An empty word in a command like `set LABEL' provokes a segfault from
sym-test -- not entirely unreasonably considering that sym-test is a
quick lash-up and not intended to be robust against bogus test scripts.
So filter them out in advance.

sym-gtest

index 3dd6ed6..ac5bcaf 100755 (executable)
--- a/sym-gtest
+++ b/sym-gtest
@@ -18,7 +18,7 @@ sub random ($) {
 $words = "/usr/dict/words";
 -r $words or $words = "/usr/share/dict/words";
 open(DICT, $words) or die("open($words): $!");
-@w = <DICT>;
+@w = grep /./, <DICT>;
 chomp(@w);
 close(DICT);