On 2002-01-21 18:53 +0100, Hrvoje Niksic wrote:
> "Ian Abbott" <[EMAIL PROTECTED]> writes:
> 
> > Why not just open the wgetrc file in text mode using fopen(name,
> > "r") instead of "rb"? Does that introduce other problems?
> 
> Not that I'm aware of.  The reason we use "rb" now is the fact that we
> handle the EOL problem ourselves, and it seems "safer" to open the
> file in binary mode and get the real contents.

Back in my DOS days, my personal party line was to fopen all
text files in "r" mode, detect EOL by comparing with '\n' and
otherwise ignore anything that verifies isspace(). It took care of
the ^Z problem, and the code worked well on both DOS and Unix
without any #ifdefs.

-- 
André Majorel <URL:http://www.teaser.fr/~amajorel/>
std::disclaimer ("Not speaking for my employer");

Reply via email to