FreeBSD Port: qmail-1.03_3
Erik Trulsson
ertr1013 at student.uu.se
Wed Jan 26 02:44:00 PST 2005
On Tue, Jan 25, 2005 at 09:34:58PM -0800, Michael Sierchio wrote:
> Joe Marcus Clarke wrote:
>
> >>- while ((k > i) && (cmds.s[k - 1] == ' ') || (cmds.s[k - 1] == '\t'))
> >>+ while ((k > i) && ((cmds.s[k - 1] == ' ') || (cmds.s[k - 1] ==
> >>'\t')))
>
>
> >Actually, if k is less than or equal to i and cmds.s[k-1] is a tab, then
> >the first bit of code evaluates to true while the second evaluates to
> >false. I haven't looked at the rest of the code, but those statements
> >are semantically different, and I think the second is more correct.
>
> You're simply mistaken.
>
> ( 1 && 0 || 1 ) will ALWAYS evaluate to 1 on any ANSI C compiler.
No, it will evaluate to 0. && has higher precedence than ||.
(x && y || z) is equivalent to ((x && y) || z) which is different from
(x && (y || z)).
--
<Insert your favourite quote here.>
Erik Trulsson
ertr1013 at student.uu.se
More information about the freebsd-ports
mailing list