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 <[EMAIL PROTECTED]> * getdelim.c (getdelim): Return EOF on EOF. Reported by Larry Jones <[EMAIL PROTECTED]>. Regards, Derek -- Derek R. Price CVS Solutions Architect Ximbiot <http://ximbiot.com> v: +1 717.579.6168 f: +1 717.234.3125 <mailto:[EMAIL PROTECTED]> _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib