From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16494 invoked by alias); 21 Mar 2006 15:32:32 -0000 Received: (qmail 16486 invoked by uid 22791); 21 Mar 2006 15:32:31 -0000 X-Spam-Check-By: sourceware.org Received: from eastrmmtao04.cox.net (HELO eastrmmtao04.cox.net) (68.230.240.35) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 21 Mar 2006 15:32:30 +0000 Received: from localhost.localdomain ([68.9.66.48]) by eastrmmtao04.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060321153220.AUV19943.eastrmmtao04.cox.net@localhost.localdomain>; Tue, 21 Mar 2006 10:32:20 -0500 Received: from bob by localhost.localdomain with local (Exim 4.52) id 1FLir6-0002fE-Il; Tue, 21 Mar 2006 10:33:08 -0500 Date: Tue, 21 Mar 2006 16:42:00 -0000 From: Bob Rossi To: Andreas Schwab Cc: Denis PILAT , Chet Ramey , Eli Zaretskii , gdb-patches@sources.redhat.com, bash-maintainers@gnu.org Subject: Re: [patch-readline] history file reading Message-ID: <20060321153308.GC27369@brasko.net> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i 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/msg00244.txt.bz2 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? Bob Rossi