Eric Blake wrote: > According to Jim Meyering on 10/23/2009 7:48 AM: >>> So, how about this patch series? (I guess I should check whether this >>> change causes any testsuite failures, and if not, add some tests.) > > Yes, there were some test failures that I had to fix. Even some unrelated > failures (invalid-opt failed on cygwin 1.7, now that getopt-gnu allows > cygwin's getopt rather than forcing gnulib's replacement). There was also > some missing test coverage. > >> >> Both look fine. >> Adding tests would make them perfect ;-) > > Here's what I pushed (including the addition of two FIXMEs in > tests/misc/env, waiting for us to decide what to do there): ...
> +# Use -- to end arguments. > +cat <<EOF >./-i || framework_failure > +#!/bin/sh > +echo pass > +EOF > +chmod +x ./-i || framework_failure > +case `env -i PATH="$PATH" echo good` in > + good) ;; > + *) fail=1 ;; > +esac > +case `env -- -i PATH="$PATH" echo fail` in > + pass) ;; > + *) fail=1 ;; > +esac Thanks, but that cannot work (expecting to invoke ./-i) unless you have "." in your PATH. Since I don't, that new test fails for me. This patch makes it pass. Does it do what you intended? diff --git a/tests/misc/env b/tests/misc/env index a3d435b..3b632d9 100755 --- a/tests/misc/env +++ b/tests/misc/env @@ -95,7 +95,7 @@ case `env -i PATH="$PATH" echo good` in good) ;; *) fail=1 ;; esac -case `env -- -i PATH="$PATH" echo fail` in +case `PATH="$(pwd):$PATH"; export PATH; env -- -i echo fail` in pass) ;; *) fail=1 ;; esac BTW, this PATH= setting has no effect, unless your shell lacks an "echo" built-in. I suspect we have none of those anymore. > +case `env -i PATH="$PATH" echo good` in