bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getdelim doesn't set errno on failure?


From: Derek Price
Subject: Re: getdelim doesn't set errno on failure?
Date: Wed, 31 Aug 2005 14:28:32 -0400
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Oskar Liljeblad wrote:

>Well, the current Gnulib implementation doesn't behave that way.
>It will return 0 if the first call to getc fails (for whatever reason -
>error or EOF). AFAIK, the correct way to test getline/getdelim for 
>

[. . .]

>I believe the GNU libc documentation needs to be fixed.
>  
>

Whoa!  Why fix the documentation?  Why not simply return EOF on EOF, as
currently described?  The attached simple patch fixes this in
lib/getdelim.c, matching the behavior to that displayed by my local
glibc.  This fix has been tested on at least one platform which was
prevoiusly looping indefinitely around code that expected (and has
expected for years) a -1 return to signify EOF.

2005-08-31  Derek Price  <address@hidden>

        * getdelim.c (getdelim): Return EOF on EOF.
        Reported by Larry Jones <address@hidden>.

Regards,

Derek

-- 
Derek R. Price
CVS Solutions Architect
Ximbiot <http://ximbiot.com>
v: +1 717.579.6168
f: +1 717.234.3125
<mailto:address@hidden>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]