init.sh: avoid Solaris 10 /bin/sh portability problem
authorJim Meyering <meyering@redhat.com>
Tue, 8 Dec 2009 19:37:50 +0000 (20:37 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 8 Dec 2009 20:13:46 +0000 (21:13 +0100)
commit5aad650f4e093269e4184cb150f735f6999784d6
treefd5d86b751204fbfe9332ee41519946f825af9bb
parent20378b72d283e0ad87da78a24976a64faeb3b9ae
init.sh: avoid Solaris 10 /bin/sh portability problem

Solaris 10's /bin/sh does not pass '.' arguments 2..N to the
sourced script:
  $ printf 'echo "$@"\n' > f; /bin/sh -c '. ./f bar'
  $ printf 'echo "$@"\n' > f;    bash -c '. ./f bar'
  bar
tests/init.sh relied on that, accepting a --set-path=DIR argument,
and two tests used that idiom.
* tests/init.sh: Update suggested usage comments.
(path_prepend_): New function, to be used in place of
the --src-path=DIR option.
Disallow empty strings and strings containing ":".
(setup_): Move PATH-prepending code into path_prepend_.
* tests/test-pread.sh: Adapt to new usage.
* tests/test-xalloc-die.sh: Likewise.
ChangeLog
tests/init.sh
tests/test-pread.sh
tests/test-xalloc-die.sh