Re: [PATCHv5 16/16] Introduce portable_unset and use it to ensure proper && chaining
- From
Elijah Newren <newren@gmail.com>
- Date
- Oct 3, 2010, 19:41 UTC
- Message-ID
- <AANLkTi=9-rVwPN0aMg5cdhtV9yYnXCgPV4deAe3ke3At@mail.gmail.com>
- In-Reply-To
- <20101003145122.GF17084@burratino>
On Sun, Oct 3, 2010 at 8:51 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 24 quoted lines
> I think this should read
>
> portable_unset () {
> unset "$@"
> return 0
> }
>
> (or || true). That is, if I try
>
> portable_unset "foo bar"
>
> then on platforms where an envvar named "foo bar" is allowed,
> this should unset it, no?
>
> Also, maybe a comment could guide people in using this:
>
> # In some bourne shell implementations, the "unset" builtin
> # returns nonzero status when a variable to be unset was not
> # set in the first place.
> #
> # Use portable_unset when that should not be considered an
> # error.
>
> An update to t/README would be nice, too. :)Yes, all the above sounds good, as does your other changes on this series that I didn't yet comment on; I made the relevant changes for all these comments. Thanks!