bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in history handling, bash-3.0, Solaris-SPARC-9


From: Chet Ramey
Subject: Re: bug in history handling, bash-3.0, Solaris-SPARC-9
Date: Thu, 26 Aug 2004 08:55:41 -0400

> Machine Type: sparc-sun-solaris2.9
> 
> Bash Version: 3.0
> Patch Level: 0
> Release Status: release
> 
> Description:
>         When scrolling up and down in the command history, if you return to 
> the bottom (current position)   
>         you do not end up with a blank line following the prompt, but rather 
> with a random command from  
>         somewhere in the history list.  The command you are presented with is 
> not necessarily the one 
>         you stop on when scrolling back, but does seem to be from soemwhere 
> in the intervening lines.

Try this:

*** ../bash-3.0/lib/readline/misc.c     Wed Jul  7 08:56:32 2004
--- lib/readline/misc.c Sat Aug  7 22:38:53 2004
***************
*** 277,286 ****
        _rl_saved_line_for_history->data = (char *)rl_undo_list;
      }
-   else if (STREQ (rl_line_buffer, _rl_saved_line_for_history->line) == 0)
-     {
-       free (_rl_saved_line_for_history->line);
-       _rl_saved_line_for_history->line = savestring (rl_line_buffer);
-       _rl_saved_line_for_history->data = (char *)rl_undo_list;        /* XXX 
possible memleak */
-     }
  
    return 0;
--- 277,280 ----
*** ../bash-3.0/lib/readline/vi_mode.c  Tue Jul 13 14:08:27 2004
--- lib/readline/vi_mode.c      Tue Aug 17 00:12:09 2004
***************
*** 273,280 ****
--- 273,282 ----
      {
      case '?':
+       _rl_free_saved_history_line ();
        rl_noninc_forward_search (count, key);
        break;
  
      case '/':
+       _rl_free_saved_history_line ();
        rl_noninc_reverse_search (count, key);
        break;

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@po.cwru.edu    http://tiswww.tis.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]