diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-06-20 07:06:54 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-06-20 07:08:43 -0700 |
commit | c8485c41608e18bd1ab5ccfa9f8e5922f5c35c10 (patch) | |
tree | 0f14e4db2ad65405523342e36c83083c8034ab79 /tests | |
parent | 4f3bf3d1842d49f1ee1d5164fcc16e01738c6a29 (diff) | |
download | gnulib-c8485c41608e18bd1ab5ccfa9f8e5922f5c35c10.tar.gz |
init.sh: do not rely on autoupated PWD
This addresses symptoms of the problem reported by Nelson H.F. Beebe in
<http://lists.gnu.org/archive/html/bug-gzip/2012-06/msg00008.html>.
Although Nelson's bug was not necessarily fixed by this patch,
it seems wise to make the change for safety.
* tests/init.sh (path_prepend_): Do not rely on PWD updating
automagically after 'cd'; this is not reliable on older shells.
(setup_): Fail if we cannot cd to temporary directory.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/init.sh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/init.sh b/tests/init.sh index f525a7cab4..5f6e6387e2 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -411,8 +411,7 @@ path_prepend_ () case $path_dir_ in '') fail_ "invalid path dir: '$1'";; /*) abs_path_dir_=$path_dir_;; - *) abs_path_dir_=`cd "$initial_cwd_/$path_dir_" && echo "$PWD"` \ - || fail_ "invalid path dir: $path_dir_";; + *) abs_path_dir_=$initial_cwd_/$path_dir_;; esac case $abs_path_dir_ in *:*) fail_ "invalid path dir: '$abs_path_dir_'";; @@ -448,7 +447,7 @@ setup_ () pfx_=`testdir_prefix_` test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ || fail_ "failed to create temporary directory in $initial_cwd_" - cd "$test_dir_" + cd "$test_dir_" || fail_ "failed to cd to temporary directory" # As autoconf-generated configure scripts do, ensure that IFS # is defined initially, so that saving and restoring $IFS works. |