On Thu, 31 May 2012, James Harper <james.harper(a)bendigoit.com.au> wrote:
Is there a
library routine like fgets() but which takes any of CR, NL,
and CR+NL as an end of line?
I'm pretty sure there isn't. Is using sscanf out of the question? You may
be able to construct a format string that does what you want unless you
really do want a CR by itself to also represent a linefeed (which I can't
think how to do using sscanf).
I really need to support either.
I'm dealing with the output of a Windows program that seems to convert between
DOS and Unix file formats.
So Peter's suggestion of getdelim() isn't going to help me this time, although
it's a handy thing to note for future reference.
--
My Main Blog
http://etbe.coker.com.au/
My Documents Blog
http://doc.coker.com.au/