From c8485c41608e18bd1ab5ccfa9f8e5922f5c35c10 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 20 Jun 2012 07:06:54 -0700 Subject: [PATCH] init.sh: do not rely on autoupated PWD This addresses symptoms of the problem reported by Nelson H.F. Beebe in . 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. --- ChangeLog | 11 +++++++++++ tests/init.sh | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 073a9c879..e0e827de1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2012-06-20 Paul Eggert + + init.sh: do not rely on autoupated PWD + This addresses symptoms of the problem reported by Nelson H.F. Beebe in + . + 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. + 2012-06-19 Bruno Haible stat, fstat: Avoid warnings on mingw64. diff --git a/tests/init.sh b/tests/init.sh index f525a7cab..5f6e6387e 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. -- 2.11.0