and die "$ME: $dir does not contain old CWD\n";
my $dir_prefix = $slash ? substr ($dir, 0, $slash) : '/';
my ($d, $i) = (stat $dir_prefix)[0, 1];
- $d == $dev && $i == $ino
+ $d eq $dev && $i eq $ino
and return substr $dir, $slash + 1;
}
}
# Set up a safe, well-known environment
-delete @ENV{qw(BASH_ENV CDPATH ENV PATH)};
+delete @ENV{qw(BASH_ENV CDPATH ENV)};
$ENV{IFS} = '';
+# PATH is tricky - we can't just clear it, or cygwin will fail. But we
+# can't use it as-is, or taint checking in `` will stop us. For this
+# script, it is enough to scrub the incoming $PATH first.
+$ENV{'PATH'} =~ /(.*)/;
+$ENV{'PATH'} = "$1";
# Save CWD's device and inode numbers.
my ($dev, $ino) = (stat '.')[0, 1];
my $i = 0;
do
{
- mkdir $z, 0700
- or die "$ME: at depth $i: $!\n";
- chdir $z;
+ if (!mkdir $z, 0700)
+ {
+ warn "$ME: skipping this test; cannot create long directory name "
+ . "at depth $i: $!\n";
+ exit 77;
+ }
+ chdir $z
}
until (++$i == $n);
my $build_src_dir = "$abs_top_builddir/src";
if ($build_src_dir !~ m!^([-+.:/\w]+)$!)
{
- warn "$0: skipping this test; odd build source directory name:\n"
+ warn "$ME: skipping this test; odd build source directory name:\n"
. "$build_src_dir\n";
exit 77;
}
fail=0
-# This should force the use of temp files compressed with the default gzip
+# This should force the use of temp files
sort -S 1k in > out || fail=1
compare exp out || fail=1
test -f ok || fail=1
rm -f dzip ok
-# This is to make sure sort functions if it can't find the default gzip
-PATH=. "$SORT" -S 1k in > out || fail=1
-compare exp out || fail=1
-
Exit $fail
$ENV{LC_ALL} = 'C';
# Set up a safe, well-known environment
-delete @ENV{qw(BASH_ENV CDPATH ENV PATH)};
+delete @ENV{qw(BASH_ENV CDPATH ENV)};
$ENV{IFS} = '';
+# PATH is tricky - we can't just clear it, or cygwin will fail. But we
+# can't use it as-is, or taint checking in `` will stop us. For this
+# script, it is enough to scrub the incoming $PATH first.
+$ENV{'PATH'} =~ /(.*)/;
+$ENV{'PATH'} = "$1";
my @dir_list = qw(/tmp /var/tmp /usr/tmp);
my $rm = "$ENV{abs_top_builddir}/src/rm";