From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17411 invoked by alias); 21 Mar 2006 14:58:48 -0000 Received: (qmail 17400 invoked by uid 22791); 21 Mar 2006 14:58:48 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 21 Mar 2006 14:58:47 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FLiJm-0006jt-Fp; Tue, 21 Mar 2006 09:58:42 -0500 Date: Tue, 21 Mar 2006 15:38:00 -0000 From: Daniel Jacobowitz To: Denis PILAT , Chet Ramey Cc: Eli Zaretskii , gdb-patches@sources.redhat.com, bash-maintainers@gnu.org Subject: Re: [patch-readline] history file reading Message-ID: <20060321145842.GA25689@nevyn.them.org> Mail-Followup-To: Denis PILAT , Chet Ramey , Eli Zaretskii , gdb-patches@sources.redhat.com, bash-maintainers@gnu.org References: <44196BC6.4050503@st.com> <441FD3C7.1090504@st.com> <44201202.3010001@case.edu> <44196BC6.4050503@st.com> <441FD3C7.1090504@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44201202.3010001@case.edu> <441FD3C7.1090504@st.com> User-Agent: Mutt/1.5.8i 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/msg00242.txt.bz2 On Tue, Mar 21, 2006 at 09:47:30AM -0500, Chet Ramey wrote: > Denis PILAT wrote: > > >> > > This new version of my patch changes the way we read history files to > > allow "\r\n" in end-of-line. > > I don't change any more the way we write history files. > > I don't see any problem with including this, or a variant. Fine by me too. Denis, if you plan to continue submitting GDB patches, I think this is the point where I talk about coding style :-) On Tue, Mar 21, 2006 at 11:21:59AM +0100, Denis PILAT wrote: > 2006-03-21 Denis Pilat > > * histfile.c (read_history_range): remove '\r' character from > history lines > to allow reading files with Windows like end-of-line on unix host. Our ChangeLog entries have two spaces between date and name, and two between name and date. The indented portion starts with a tab on every line. The first character should usually be capitalized. Also, they cover only "what" and not "why". 2006-03-21 Denis Pilat * histfile.c (read_history_range): Remove '\r' character from history lines. > Index: histfile.c > =================================================================== > --- histfile.c (revision 386) > +++ histfile.c (working copy) > @@ -228,7 +228,11 @@ > for (line_end = line_start; line_end < bufend; line_end++) > if (*line_end == '\n') > { > - *line_end = '\0'; > + /* allow reading files with Windows like end-of-line */ Comments start with a capital, and end with a period and two spaces. /* Allow reading files with Windows-like end-of-line. */ > + if ( line_end - 1 >= line_start && *( line_end - 1 ) =='\r' ) > + *( line_end - 1 ) = '\0'; And you don't need the spaces inside the parentheses, but do usually need spaces around operators: if (line_end - 1 >= line_start && *(line_end - 1) == '\r') *(line_end - 1) = '\0'; > + else > + *line_end = '\0'; > > if (*line_start) > add_history (line_start); I've checked this in with formatting fixes. -- Daniel Jacobowitz CodeSourcery