This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: [PATCH] setup.exe: Stop NetIO_HTTP from treating entire stream as a header
- From: Christopher Faylor <cgf at redhat dot com>
- To: cygwin-patches at cygwin dot com
- Date: Tue, 27 Nov 2001 13:42:23 -0500
- Subject: Re: [PATCH] setup.exe: Stop NetIO_HTTP from treating entire stream as a header
- References: <3C035977.BF151D0A@syntrex.com> <000601c17772$7c5ecfd0$2101a8c0@d8rc020b>
- Reply-to: cygwin-patches at cygwin dot com
On Tue, Nov 27, 2001 at 12:36:52PM -0600, Gary R Van Sickle wrote:
>> "Gary R. Van Sickle" wrote:
>> >
>> > Ok, setup.exe seems to work much better with this patch
>> applied (also attached):
>>
>> Yep, I'm the one that screwed this up. Here is how it was before
>> my patch was applied.
>>
>> do {
>> l = s->gets ();
>> if (_strnicmp (l, "Content-Length:", 15) == 0)
>> sscanf (l, "%*s %d", &file_size);
>> } while (*l);
>>
>>
>> What about replacing this in your patch:
>> > + while (((l = s->gets ()) != 0) && (strlen(l) != 0))
>> with
>> + while (((l = s->gets ()) != 0) && *l)
>>
>
>Ah, better yet. Jeez you guys are clever ;-). But how about we make it:
>
> while (((l = s->gets ()) != 0) && (*l != '\0'))
>
>in the interest of making it a bit more self-documenting?
Actually, how about not using != 0. Use NULL in this context.
I don't think that *l is hard to understand, fwiw.
cgf