tests defs: sanitize IFS
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 23 Jan 2011 11:54:35 +0000 (12:54 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 23 Jan 2011 12:19:16 +0000 (13:19 +0100)
* tests/defs.in ($IFS): Define to <space>, <tab>, <newline>.
($sp): New variable, holding a single whitespace character.
($tab): New variable, holding a tabulation character.
($nl): New variable, holding a newline character.

ChangeLog
tests/defs.in

index 48f0ce2..a12a8d3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-01-23  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tests defs: sanitize IFS
+       * tests/defs.in ($IFS): Define to <space>, <tab>, <newline>.
+       ($sp): New variable, holding a single whitespace character.
+       ($tab): New variable, holding a tabulation character.
+       ($nl): New variable, holding a newline character.
+
 2011-01-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        tests: fix VPATH auto-expansion workarounds.
index ee19dbe..21fcc34 100644 (file)
@@ -34,6 +34,18 @@ else
   case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 fi
 
+# A single whitespace character.
+sp=' '
+# A tabulation character.
+tab='  '
+# A newline character.
+nl='
+'
+
+# As autoconf-generated configure scripts do, ensure that IFS
+# is defined initially, so that saving and restoring $IFS works.
+IFS=$sp$tab$nl
+
 # Ensure we are running from the right directory.
 test -f ./defs || {
    echo "defs: not found in current directory" 1>&2