🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #10205

readline package does not handle unknown func. name in .inputrc +FIX

#10205
From: Shigeya Suzuki
Date: Fri, 26 Jan 1990 03:15
92 lines
2936 bytes
I don't know whether this bug fix has already posted to some gnu*
group, just a minor bug, but it dumps core without any messages!

Index:	bash(1.04) or gdb(3.2[d] at least..)

Description:
	readline does not handle undefined key functio name.
	
Repeat-By:
	in ~/.inputrc, define for example:

		M-l: possilbe-completions
                          ^^

	run gdb, dumps core.

Fix:
	1. rl_named_function incorrectly checked end of the keymap table.
	2. rl_parse_and_bind does not check the error from rl_named_function.

	I'm not sure change to rl_parse_and_bind is good enough
	(for the readline designer's point of view)

	Apply follwing patch:


*** readline.c.ORIG	Sat Jul  8 06:45:21 1989
--- readline.c	Fri Jan 26 12:00:35 1990
***************
*** 3794,3800 ****
  {
    register int i;
  
!   for (i = 0; funmap[i]->name; i++)
      if (stricmp (funmap[i]->name, string) == 0)
        return (funmap[i]->function);
    return ((Function *)NULL);
--- 3794,3800 ----
  {
    register int i;
  
!   for (i = 0; funmap[i] && funmap[i]->name; i++)
      if (stricmp (funmap[i]->name, string) == 0)
        return (funmap[i]->function);
    return ((Function *)NULL);
***************
*** 3871,3877 ****
  {
    char *rindex (), *funname, *kname;
    int key, i;
! 
    if (!string || !*string || *string == '#')
      return;
  
--- 3871,3878 ----
  {
    char *rindex (), *funname, *kname;
    int key, i;
!   Function *funcp;
!   
    if (!string || !*string || *string == '#')
      return;
  
***************
*** 3925,3931 ****
    if (substring_member_of_array (string, possible_meta_prefixes))
      key = META (key);
  
!   rl_bind_key (key, rl_named_function (funname));
  }
  
  rl_variable_bind (name, value)
--- 3926,3937 ----
    if (substring_member_of_array (string, possible_meta_prefixes))
      key = META (key);
  
!   if ((funcp = rl_named_function (funname)) == NULL) {
!     fprintf (stderr, "Warning: Function %s does not exist. check .inputrc\r\n", funname);
!     fflush (stderr);
!   }
!   else
!     rl_bind_key (key, funcp);
  }
  
  rl_variable_bind (name, value)

---
					Shigeya Suzuki

					shige%foretune.co.jp@uunet.uu.net
					..!uunet!kddlabs!lkbreth!shige
Technical Details
Message-ID: <9001260316.AA10924@lkbreth.foretune.co.jp>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!sunic!uupsi!rpi!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!foretune.co.jp!shige

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,9711ba576fccc30c,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 1990-01-25 19:15:51 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!sunic!uupsi!rpi!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!foretune.co.jp!shige
From: shige@foretune.co.jp (Shigeya Suzuki)
Newsgroups: gnu.gdb.bug
Subject: readline package does not handle unknown func. name in .inputrc +FIX
Message-ID: <9001260316.AA10924@lkbreth.foretune.co.jp>
Date: 26 Jan 90 03:15:51 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 92
Posted: Fri Jan 26 04:15:51 1990