httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barrie Slaymaker <barr...@slaysys.com>
Subject Re: cvs commit: httpd-2.0/server core.c request.c
Date Mon, 27 Aug 2001 21:11:58 GMT
On Mon, Aug 27, 2001 at 09:47:28AM -0500, William A. Rowe, Jr. wrote:
>     if ((core_a->r != NULL) < (core_b->r != NULL)) {
>         return -1;
>     }
>     else if ((core_a->r != NULL) > (core_b->r != NULL)) {
>         return 1;
>     }
> 
> does that look better :-?  I'll commit as soon as someone tells me sanity (or at least
> my abuse of pointers as bools) is cured :)

Ack, my C is getting too rusty.  I seem to recall that (1 < 0) < (0 < 1)
not portable.  Perhaps the

>     if ((core_a->r == NULL) && (core_b->r != NULL)) {

style reads better, I dunno.

Is it 100% certain that the component counts are always 0 (or some known
value) for regex sections?  Haven't peeked at the source to check that.
If not, an additional else {...} defending the component count comparison
when in regex sections might be safer.


Oh, well, enough C golf for today ;-).

- Barrie

Mime
View raw message