From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18748 invoked by alias); 17 Mar 2006 10:42:19 -0000 Received: (qmail 18740 invoked by uid 22791); 17 Mar 2006 10:42:19 -0000 X-Spam-Check-By: sourceware.org Received: from gandalf.inter.net.il (HELO gandalf.inter.net.il) (192.114.186.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 17 Mar 2006 10:42:18 +0000 Received: from nitzan.inter.net.il (nitzan.inter.net.il [192.114.186.20]) by gandalf.inter.net.il (MOS 3.7.1-GA) with ESMTP id IEF04079; Fri, 17 Mar 2006 12:42:12 +0200 (IST) Received: from HOME-C4E4A596F7 (IGLD-84-228-141-3.inter.net.il [84.228.141.3]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id CXJ86500 (AUTH halo1); Fri, 17 Mar 2006 12:42:11 +0200 (IST) Date: Fri, 17 Mar 2006 16:07:00 -0000 Message-Id: From: Eli Zaretskii To: Denis PILAT CC: gdb-patches@sources.redhat.com, bash-maintainers@gnu.org In-reply-to: <44196BC6.4050503@st.com> (message from Denis PILAT on Thu, 16 Mar 2006 14:44:38 +0100) Subject: Re: [patch-readline] history file generation on minGW host Reply-to: Eli Zaretskii References: <44196BC6.4050503@st.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00225.txt.bz2 > Date: Thu, 16 Mar 2006 14:44:38 +0100 > From: Denis PILAT > > 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?