Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Fishier code in handlefeatures
- X-seq: zsh-workers 34100
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: ZyX <kp-pav@xxxxxxxxx>
- Subject: Re: Fishier code in handlefeatures
- Date: Tue, 6 Jan 2015 01:32:38 +0100
- Cc: Peter Stephenson <p.stephenson@xxxxxxxxxxx>, zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=PbqOhYURROlZryD2i+1Aqm/6DVQ5qKBzVHYZd5r46+Q=; b=Egno1LGhSXs8hytHtPgl3vkLDmTeyXh9DZbYhF59PB7H7nZNJZRnvDBqXC/VMAtYFT oVNdCCFEeK1uwXuNAtaU+fNcvHlox1aOzBNWLGfTp6bPgojNeQU8FKfTSqQMfTXQff1W QdoskCs41LnZYRLSX10yOm6Zc7h/hlYwnVay4tWWw8JiTR7GAPBvjxw9CcsCrm69yZP5 CEeEYnfiZ2g7HPjSfzLeVVZienE+HILskP9djb/Iplmb/KuqP+bV4cYm/SH4iDuWRsZy wSWdQt+AFnjgvJE0aI+DyHfVTBYKflOPdFabxQAQcOGqRmK4Va04Ju+lhGUSU9kupkxQ IqDQ==
- In-reply-to: <1999441420503885@web17g.yandex.ru>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAHYJk3RZ_1pcJEfJjUqT8P+kxrEOqBudHvdZqWoK6ZsdkP=G4A@mail.gmail.com> <1999441420503885@web17g.yandex.ru>
On Tue, Jan 6, 2015 at 1:24 AM, ZyX <kp-pav@xxxxxxxxx> wrote:
> 06.01.2015, 03:21, "Mikael Magnusson" <mikachu@xxxxxxxxx>:
>> mod_export int
>> handlefeatures(Module m, Features f, int **enables)
>> {
>> if (!enables || *enables)
>> return setfeatureenables(m, f, *enables);
>> *enables = getfeatureenables(m, f);
>> return 0;
>> }
>>
>> so if enables is NULL, we immediately do *enables? I'm not sure what's
>> intended here but obviously it somehow works.
>
> NULL is false, so if enables is NULL !enables is true and *enables is not evaluated due to short-circuiting. Nothing wrong here.
Read the next line too.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author