This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch-readline] history file generation on minGW host
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Denis PILAT <denis dot pilat at st dot com>
- Cc: gdb-patches at sources dot redhat dot com, bash-maintainers at gnu dot org
- Date: Fri, 17 Mar 2006 12:42:20 +0200
- Subject: Re: [patch-readline] history file generation on minGW host
- References: <44196BC6.4050503@st.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Thu, 16 Mar 2006 14:44:38 +0100
> From: Denis PILAT <denis.pilat@st.com>
>
> On minGW host, history file are open in text mode, that's imply windows
> specific
> carriage return to be inserted ( \n -> \r\n conversion performed) and
> prevents windows history file to be compliant with linux one's.
> When using current history file for windows, "^M" appears at each end of
> line.
>
> This patch fixes this problem.
Thanks.
However, I think there's a better fix: teach readline to always remove
any CRs before an LF character, even on Posix platforms. That way,
even if the history file was edited by some Windows editor that
doesn't honor the end-of-line format, it can still be read on any OS.
And as a bonus, we might get a cleaner code, without ugly OS-dependent
#ifdef's.
Unless Chet and others disagree, would you like to prepare a patch
along these lines?