cr/lf conundrum

DJ Delorie
Fri May 19 13:27:00 GMT 2000

OK, I've been working on the CR/LF problem, and I've come down to a
problem that isn't easily solved:

	getc() and putc() are macros.

That means that part of the buffering system in stdio is in the
application, not the dll, so there's no way I can fix the application
to use the new scheme, which moves CR/LF conversions to the stdio
buffering layer (to fix ftell()).  That means that any existing
program that uses getc or putc (or putchar, fgetc, or any other macro
derivitive) is going to do binary I/O for those calls, no matter what.

The reason this is a big deal is because it affects terminal I/O too,
that is, you get stairstepped text:

because there are no CR's to move the cursor back to the beginning of
the line.

There are a couple of things I can do to prevent this type of problem
in the future (namely, making getc/putc *not* be macros), but I can't
think of a good solution to handle existing applications.  I can think
of many hacks, but they all have drawbacks.


More information about the Cygwin-developers mailing list