]> diplodocus.org Git - nmh/blobdiff - test/common.sh.in
Removed a bunch of unreachable break statements found by
[nmh] / test / common.sh.in
index 49e1c48ec847568a4d18addf6522b53ea3d8aa6a..6c9652ced8c6370fa4a238f3ae1009a3f739e99e 100644 (file)
@@ -126,15 +126,16 @@ check_for_hard_links () {
   set -e
 }
 
-#### Filter that squeezes blank lines, emulating GNU cat -s.
+#### Filter that squeezes blank lines, partially emulating GNU cat -s,
+#### but sufficient for our purpose.
+#### From http://www-rohan.sdsu.edu/doc/sed.html, compiled by Eric Pement.
 squeeze_lines() {
-  awk '!length() && e {next} {e = !length()} 1'
+  sed '/^$/N;/\n$/D'
 }
 
-#### Filter that inserts initial whitespace and converts non-breakable
-#### space U+00A0 to an ASCII space.
+#### Filter that converts non-breakable space U+00A0 to an ASCII space.
 prepare_space() {
-  sed 's/^/ /; s/'"`printf '\\302\\240'`"'/ /g'
+  sed 's/'"`printf '\\302\\240'`"'/ /g'
 }
 
 #### check() requires two arguments, each the name of a file to be