This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: DOS/Windows-specific code: source.c



On Tue, 8 May 2001, Christopher Faylor wrote:

> >> Actually, why not always just use O_BINARY in this file without the
> >> conditional and remove the use of O_BINARY everywhere else?
> >
> >Because it's wrong to read source files in binary mode.
> 
> Not necessarily.  If you are storing CTRL-Zs in the source file, it might
> make sense on MS-DOS and Windows.

You can't in practice store ^Z in a text file on DOS/Windows, because
95% of text editors on those systems will stop reading the file when
they see the first ^Z.  Unless you can force everybody to use either
Emacs or Cygwin-compiled editors, you can safely assume any ^Z
character in a text file marks the end of the file, and should not be
displayed.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]