From: Eli Zaretskii <eliz@gnu.org>
To: gdb@sources.redhat.com
Subject: Re: text file formats
Date: Thu, 06 Apr 2006 19:01:00 -0000 [thread overview]
Message-ID: <uhd567cxx.fsf@gnu.org> (raw)
In-Reply-To: <20060406131514.GH11610@brasko.net> (message from Bob Rossi on Thu, 6 Apr 2006 09:15:14 -0400)
> Date: Thu, 6 Apr 2006 09:15:14 -0400
> From: Bob Rossi <bob_rossi@cox.net>
> Cc: gdb@sources.redhat.com
>
> > (a) For native end-of-line (EOL) format, use the native C library and
> > specify the text-mode I/O when you open the file.
> >
> > (b) For non-native but consistent EOL format, read the file in binary
> > mode, analyze its first chunk, and then manually convert the
> > original EOL markers into literal \n.
>
> OK, that's fine, except, you don't know if the file is native/non-native
> EOL until you open it and process the entire file.
You do know that if all you want to handle is the native format.
If you want to handle non-native formats as well, you must do (b).
> > The only two methods I know of to handle the mixed case are:
> >
> > (1) Fall back to Unix-style EOL and show the ^M literally.
>
> OK.
> > (2) Let the user specify the EOL and then apply the (b) strategy
> > above.
>
> OK, that's fine, but is this what GDB, GCC do?
No, that's what Emacs does. Daniel told you what GDB does. As for
GCC, I simply don't know, but I think it does handle DOS-style CR-LF
EOLs on non-Windows machines. Not sure about the (old) Mac style.
prev parent reply other threads:[~2006-04-06 18:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-05 22:31 Bob Rossi
2006-04-05 23:39 ` Daniel Jacobowitz
2006-04-06 0:14 ` Bob Rossi
2006-04-06 1:17 ` Daniel Jacobowitz
2006-04-06 3:27 ` Bob Rossi
2006-04-06 3:35 ` Eli Zaretskii
2006-04-06 5:06 ` Daniel Jacobowitz
2006-04-06 13:03 ` Daniel Jacobowitz
2006-04-06 14:01 ` Bob Rossi
2006-04-06 14:41 ` Daniel Jacobowitz
2006-04-06 19:20 ` Eli Zaretskii
2006-04-06 19:32 ` Bob Rossi
2006-04-06 23:55 ` Daniel Jacobowitz
2006-04-07 13:33 ` Eli Zaretskii
2006-04-06 20:55 ` Paul Koning
2006-04-07 11:54 ` Eli Zaretskii
2006-04-06 19:07 ` Eli Zaretskii
2006-04-06 3:47 ` Eli Zaretskii
2006-04-06 4:29 ` Daniel Jacobowitz
2006-04-06 4:30 ` Daniel Jacobowitz
2006-04-06 3:43 ` Eli Zaretskii
2006-04-06 13:35 ` Bob Rossi
2006-04-06 19:01 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=uhd567cxx.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox