[gnu.gdb.bug] Bug in command line edit library: readline

dredge@sierra.Stanford.EDU (Michael Eldredge) (02/14/90)

 I have been using the command line edit / history library that is
 used in bash and gdb for a while.  I am a KSH vi-mode addict and
 the availability of the simple readline() routine has meant that all
 of the programs in our research group now work the same way --
 offering command line edits and history.  For those that haven't
 used it, "check it out".  [Some documentation on the programmer's
 interface would be nice.] End of commercial.

 The bug and fix are in vi_mode.c

	RCS file: RCS/vi_mode.c,v
	retrieving revision 1.1
	diff  -r1.1 vi_mode.c
	78c78
	<   p = (char *)alloca (2 + rl_prompt ? strlen (rl_prompt) : 0);
	---
	>   p = (char *)alloca (2 + (rl_prompt ? strlen (rl_prompt) : 0) );

 This caused a core dump on a Sun3 when trying a history search.
 The parens are needed to get the precedence correct.

 Hope this helps someone.

 Michael Eldredge
 Stanford IC Lab