X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/dd7b25c911e759b70905a623eacd5b6fdf3e630b..42915204e00cf23697a491b8a998f9ccbf8cc349:/test/common.sh.in?ds=inline diff --git a/test/common.sh.in b/test/common.sh.in index 94b41906..6c9652ce 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -126,17 +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($0) == 0 && e == 1 { next } - { e = length($0) == 0 } - { print }' + 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