From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20238 invoked by alias); 21 Mar 2006 15:38:17 -0000 Received: (qmail 20229 invoked by uid 22791); 21 Mar 2006 15:38:16 -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 15:38:15 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FLivw-00072h-Np; Tue, 21 Mar 2006 10:38:08 -0500 Date: Tue, 21 Mar 2006 16:46:00 -0000 From: Daniel Jacobowitz To: Andreas Schwab , Denis PILAT , Chet Ramey , Eli Zaretskii , gdb-patches@sources.redhat.com, bash-maintainers@gnu.org Subject: Re: [patch-readline] history file reading Message-ID: <20060321153808.GA27039@nevyn.them.org> Mail-Followup-To: Andreas Schwab , 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> <20060321145842.GA25689@nevyn.them.org> <20060321153308.GC27369@brasko.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060321153308.GC27369@brasko.net> 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/msg00245.txt.bz2 On Tue, Mar 21, 2006 at 10:33:08AM -0500, Bob Rossi wrote: > On Tue, Mar 21, 2006 at 04:30:11PM +0100, Andreas Schwab wrote: > > Daniel Jacobowitz writes: > > > > >> + 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'; > > > > line_end[-1] whould be much better readable, IMHO. > > Can you even index into an array with a negitive number? Certainly. And I agree with Andreas (though not enough to go back and change code someone else has written). -- Daniel Jacobowitz CodeSourcery