summaryrefslogtreecommitdiff
path: root/tests/ls/color-clear-to-eol
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-09-07 19:36:21 +0200
committerJim Meyering <meyering@redhat.com>2009-09-07 19:36:37 +0200
commit9547a78bda1d4f01a782c869be248b5e0faf31f9 (patch)
treebe38cae682238510f2793cadb4a43c12646b2287 /tests/ls/color-clear-to-eol
parent494fed027114d63719439b399a7602f8d0384bcf (diff)
downloadcoreutils-9547a78bda1d4f01a782c869be248b5e0faf31f9.tar.xz
tests: ls/color-clear-to-eol: append NL to accommodate old sed
* tests/ls/color-clear-to-eol: Some vendor sed programs fail to operate on lines that are not NL-terminated. This affects at least Solaris 10's /bin/sed. Reported by Pádraig Brady.
Diffstat (limited to 'tests/ls/color-clear-to-eol')
-rwxr-xr-xtests/ls/color-clear-to-eol6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/ls/color-clear-to-eol b/tests/ls/color-clear-to-eol
index 92cf8a8ca..fd65ced08 100755
--- a/tests/ls/color-clear-to-eol
+++ b/tests/ls/color-clear-to-eol
@@ -30,11 +30,15 @@ e='\33'
color_code='0;31;42'
c_pre="$e[0m$e[${color_code}m"
c_post="$e[0m$e[K\n$e[m"
-printf "$c_pre$long_name$c_post" > exp || framework_failure
+printf "$c_pre$long_name$c_post\n" > exp || framework_failure
fail=0
env TERM=xterm COLUMNS=80 LS_COLORS="*.foo=$color_code" TIME_STYLE=+T \
ls -og --color=always $long_name > out || fail=1
+
+# Append a newline, to accommodate less-capable versions of sed.
+echo >> out || fail=1
+
sed 's/.*T //' out > k && mv k out
compare out exp || fail=1