This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch-readline] history file reading
On Tue, Mar 21, 2006 at 04:30:11PM +0100, Andreas Schwab wrote:
> Daniel Jacobowitz <drow@false.org> 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