🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #828

Bug in command line edit library: readline() vi_mode

#828
From: Michael Eldredge
Date: Tue, 13 Feb 1990 22:43
26 lines
1373 bytes
 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
Technical Details
Message-ID: <505@sierra.stanford.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!uunet!shelby!dredge@sierra.Stanford.EDU

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!uunet!shelby!dredge@sierra.Stanford.EDU
From: dredge@sierra.Stanford.EDU (Michael Eldredge)
Newsgroups: gnu.gdb.bug,gnu.bash.bug
Subject: Bug in command line edit library: readline() vi_mode
Message-ID: <505@sierra.stanford.edu>
Date: 13 Feb 90 22:43:28 GMT
Sender: dredge@sierra.STANFORD.EDU (Michael Eldredge)
Reply-To: dredge@sierra.Stanford.EDU (Michael Eldredge)
Organization: Stanford University
Lines: 26