diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2004-07-28 19:23:07 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2004-07-28 19:23:07 +0000 |
commit | f4bc6c5d12e74334700a6c6233e86c7ea6a10978 (patch) | |
tree | 72e79a5d54a8fb81e4fc3550763a53b1b79d3f55 | |
parent | d2d008b6fecf35872eab0fc7d59d818b33677ad2 (diff) | |
download | coreutils-f4bc6c5d12e74334700a6c6233e86c7ea6a10978.tar.xz |
Don't assume that Perl's getpwd agrees with our
pwd when there are multiple names for the working directory
(which can happen with an automounter, sigh).
-rwxr-xr-x | tests/misc/pwd | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/misc/pwd b/tests/misc/pwd index 74bbc224f..7975960e4 100755 --- a/tests/misc/pwd +++ b/tests/misc/pwd @@ -8,12 +8,12 @@ $PERL -e 1 > /dev/null 2>&1 || { exit 77 } -pwd=`pwd` +framework_failure=0 +pwd=`${BUILD_SRC_DIR?}/pwd` || framework_failure=1 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0 trap '(exit $?); exit $?' 1 2 13 15 -framework_failure=0 mkdir -p $tmp || framework_failure=1 cd $tmp || framework_failure=1 @@ -25,6 +25,9 @@ fi ARGV_0=$0 export ARGV_0 +CWD=$pwd/$tmp +export CWD + $PERL -w -- - <<\EOF # Show that pwd works even when the length of the resulting @@ -34,8 +37,7 @@ use Cwd; (my $ME = $ENV{ARGV_0}) =~ s|.*/||; -my $cwd = getcwd; -chomp $cwd; +my $cwd = $ENV{CWD}; my $z = 'z' x 31; my $n = 256; my $expected = $cwd . ("/$z" x $n); |