[libcpp] [PATCH] Handle DOS EOF character for DJGPP
DJ Delorie
dj@redhat.com
Mon Apr 18 18:59:00 GMT 2005
> ^Z can legitimately appear in the middle of a file even under DJGPP.
Microsoft disagrees with you.
^Z can NOT legitimately appear in the middle of a text file under
MS-DOS derivatives, because by definition, it marks the end of the
text. Bytes after the ^Z are not technically part of the file, but
part of the disk buffers used to hold that file. It's a stupid
design, left over from the CP/M days, but that's the way it is
nonetheless.
I, personally, would not bother to support editors that actually
create files with ^Z in them, because proper support for ^Z is sloppy
at best in most MS-DOS and Windows programs, and you cannot count on
apps to correctly stop at the first ^Z character, so such editors are
going to have lots of problems anyway. But, that's no excuse to be
wrong about *why* we're allowing ^Z.
Note that all DJGPP programs reading files in text mode *will* stop at
the first ^Z character, but gcc reads text files in binary mode.
More information about the Gcc-patches
mailing list