# HG changeset patch # User Jim Meyering # Date 1259223004 -3600 # Node ID 6b87c7575253cfd12e9ef82ef4877e3f60855923 # Parent ed32b5a7bd260102ec7ba5ae8a46a7079199873b init.sh: accommodate even those who specify bogus srcdir manually * tests/init.sh: Normally, srcdir is guaranteed by automake and configure-time tests to be sanitized, so that there is no need to use "$srcdir" in Makefile rules and shell scripts. Using $srcdir (with no double quotes) suffices. However, since tests may be invoked manually, and since you may explicitly set srcdir to the name of a directory containing spaces, do quote its uses here. * tests/test-pread.sh: Likewise. Suggested by Bruno Haible. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2009-11-26 Jim Meyering + init.sh: accommodate even those who specify bogus srcdir manually + * tests/init.sh: Normally, srcdir is guaranteed by automake and + configure-time tests to be sanitized, so that there is no need to + use "$srcdir" in Makefile rules and shell scripts. Using $srcdir + (with no double quotes) suffices. However, since tests may be + invoked manually, and since you may explicitly set srcdir to the + name of a directory containing spaces, do quote its uses here. + * tests/test-pread.sh: Likewise. + Suggested by Bruno Haible. + test-pread.sh: avoid diagnostics for those who ignore SIGPIPE * tests/test-pread.sh: Write no data into the pipe, because test-pread actually reads none. This avoids a diagnostic, diff --git a/tests/init.sh b/tests/init.sh --- a/tests/init.sh +++ b/tests/init.sh @@ -210,7 +210,7 @@ # If you want to override the testdir_prefix_ function, # or to add more utility functions, use this file. -test -f $srcdir/init.cfg \ - && . $srcdir/init.cfg +test -f "$srcdir/init.cfg" \ + && . "$srcdir/init.cfg" setup_ "$@" diff --git a/tests/test-pread.sh b/tests/test-pread.sh --- a/tests/test-pread.sh +++ b/tests/test-pread.sh @@ -1,6 +1,6 @@ #!/bin/sh : ${srcdir=.} -. $srcdir/init.sh --set-path=. +. "$srcdir/init.sh" --set-path=. fail=0 : | test-pread || fail=1