Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Small bug in zsh 2.6beta9



Zvi Har'El <rl@xxxxxxxxxxxxxxxxxxxx> writes:

>> >     if (ornext ^ ret) {
>> > 
>> > should read
>> > 
>> >     if (ornext ^ (ret!=0)) {

> YOU were right all the time. The two lines of code are
> identical. Perhaps the idiom of checking if(a) rather then if(a!=0)
> is not clear to people who are not seasoned C programmers, but
> personally I prefer your original code.

I haven't really followed the discussion, but although "if (a)" and
"if (a!=0)" are equivalent, the two lines above certainly aren't.  If
ornext == 1 and ret == 2 then

ornext ^ ret == 3

but

ornext ^ (ret != 0) == 0

Bas.



Messages sorted by: Reverse Date, Date, Thread, Author