This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libcpp] [PATCH] Handle DOS EOF character for DJGPP
> ^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.