Xref: utzoo gnu.gdb.bug:490 gnu.bash.bug:1035 Path: 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 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