This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: DOS/Windows-specific code: source.c
- To: Christopher Faylor <cgf at redhat dot com>
- Subject: Re: DOS/Windows-specific code: source.c
- From: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Date: Wed, 9 May 2001 13:07:04 +0300 (IDT)
- cc: gdb at sources dot redhat dot com
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.