This is the mail archive of the guile@cygnus.com mailing list for the guile project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
>>>>> "TP" == Tim Pierce <twp@skepsis.com> writes: TP> Why fgets does not simply return the number of characters read and TP> stored is beyond me; I guess ultimately we can blame Rob Pike for this TP> nonsense. Anyway, in order to cope with embedded nulls and still be TP> able to use fast library calls, scm_fgets calls ftell to find out how TP> many characters it just read. But ftell always returns 0 for TP> non-regular files, hence the bug you noticed. Every implementation of fgets I've seen has been simple repeated invocations of getc. I'd be inclined to implement scm_fgets that way--based on getc rather than fgets. Michael.