🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #543

fix to stop rl_insert from loosing a character

#543
From: Juha Sarlin
Date: Mon, 04 Sep 1989 13:52
30 lines
1157 bytes
rl_insert() in bash 1.03 has some code to insert many characters at once.
In the rare cases when this code is run it looses the original inargument.
Here is my fix:

*** /tmp/,RCSt1a04042	Mon Sep  4 13:40:57 1989
--- readline.c	Mon Sep  4 13:38:49 1989
***************
*** 2135,2143 ****
  
  	if (chars_avail)
  	  {
! 	    int slen, key = 0, i = 0;
  	    char *string = (char *)xmalloc (slen = 20);
  
  	    while (chars_avail--)
  	      {
  		key = rl_getc (in_stream);
--- 2135,2144 ----
  
  	if (chars_avail)
  	  {
! 	    int slen, key = 0, i = 1;
  	    char *string = (char *)xmalloc (slen = 20);
  
+ 	    string[0] = c;
  	    while (chars_avail--)
  	      {
  		key = rl_getc (in_stream);
--
Juha Sarlin	juha@tds.kth.se
Technical Details
Message-ID: <8909041152.AA03640@ttds.tds.kth.se>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!tds.kth.se!juha

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!tds.kth.se!juha
From: juha@tds.kth.se (Juha Sarlin)
Newsgroups: gnu.bash.bug
Subject: fix to stop rl_insert from loosing a character
Message-ID: <8909041152.AA03640@ttds.tds.kth.se>
Date: 4 Sep 89 13:52:10 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 30