bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

portability fix for new test: printf vs \e


From: Jim Meyering
Subject: portability fix for new test: printf vs \e
Date: Thu, 19 Jul 2007 10:28:01 +0200

Expecting printf to treat \e like \033 is not portable.

diff --git a/ChangeLog b/ChangeLog
index 3e4bc42..d6e2e05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-07-19  Jim Meyering  <address@hidden>
+
+       Fix a portability bug in the new ls-color test.
+       * tests/ls/stat-free-symlinks: Don't rely on the ability of
+       a built-in printf to interpolate '\e'.  Use '\033' instead.
+
 2007-07-18  Jim Meyering  <address@hidden>

        "cp -i --update older newer" no longer prompts; same for mv
diff --git a/tests/ls/stat-free-symlinks b/tests/ls/stat-free-symlinks
index 78d91c9..260eb6c 100755
--- a/tests/ls/stat-free-symlinks
+++ b/tests/ls/stat-free-symlinks
@@ -61,9 +61,9 @@ test -s err && fail=1

 # Check that output is colorized, as requested, too.
 {
-  printf '\e[0m\e[01;address@hidden'
-  printf '\e[01;32mx\e[0m*\n'
-  printf '\e[m'
+  printf '\033[0m\033[01;address@hidden'
+  printf '\033[01;32mx\033[0m*\n'
+  printf '\033[m'
 } > exp || fail=1

 cmp out exp || fail=1
--
1.5.3.rc1.16.g9d6f




reply via email to

[Prev in Thread] Current Thread [Next in Thread]