[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: EXIT_CANCELED
From: |
Eric Blake |
Subject: |
Re: EXIT_CANCELED |
Date: |
Sat, 24 Oct 2009 11:19:49 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Jim Meyering on 10/24/2009 9:23 AM:
>> +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?
Yes, I tested with . on my PATH, and didn't catch that. Maybe it would be
smarter to rewrite the test to exercise -u instead of -i, as that is less
problematic, but your patch looks good for now.
> -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 guess some of the confusion I'm seeing is how execvp behaves when
encountering a shell script, as opposed to a binary. So there's
definitely some thought required to make sure we are writing a portable
test of env.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkrjNzQACgkQ84KuGfSFAYC+FACeI7fNniLts6phG9W+28cPNMIZ
EbAAniyMTuXXvCLzZTnEyFhw1D2OYHvv
=aK4E
-----END PGP SIGNATURE-----
- Re: system.h cleanups, (continued)
- Re: system.h cleanups, Jim Meyering, 2009/10/08
- Re: system.h cleanups, Eric Blake, 2009/10/08
- Re: system.h cleanups, Jim Meyering, 2009/10/08
- Re: system.h cleanups, Pádraig Brady, 2009/10/09
- Re: system.h cleanups, Eric Blake, 2009/10/09
- EXIT_CANCELED (was: system.h cleanups), Eric Blake, 2009/10/23
- Re: EXIT_CANCELED, Pádraig Brady, 2009/10/23
- Re: EXIT_CANCELED, Jim Meyering, 2009/10/23
- Re: EXIT_CANCELED, Eric Blake, 2009/10/23
- Re: EXIT_CANCELED, Jim Meyering, 2009/10/24
- Re: EXIT_CANCELED,
Eric Blake <=