bump version
[buildroot.git] / package / readline / readline51-004
blob2bdba2baa331990c9e9b39959fa60bafcc0fbae7
1                            READLINE PATCH REPORT
2                            =====================
4 Readline-Release: 5.1
5 Patch-ID: readline51-004
7 Bug-Reported-by: Mike Stroyan <mike.stroyan@hp.com>
8 Bug-Reference-ID: <20060203191607.GC27614@localhost>
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2006-02/msg00004.html
11 Bug-Description:
13 The displayed search prompt is corrupted when using non-incremental
14 searches in vi and emacs mode if the prompt contains non-printing
15 characters or spans multiple lines.  The prompt is expanded more than
16 once; the second time without the escape sequences that protect non-
17 printing characters from the length calculations.
19 Patch:
21 *** readline-5.1-patched/display.c      Wed Nov 30 14:05:02 2005
22 --- readline-5.1/display.c      Sat Feb 18 12:14:58 2006
23 ***************
24 *** 1983,1993 ****
25        int pchar;
26   {
27     int len;
28 !   char *pmt;
29   
30     rl_save_prompt ();
31   
32 !   if (saved_local_prompt == 0)
33       {
34         len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
35         pmt = (char *)xmalloc (len + 2);
36 --- 1998,2012 ----
37        int pchar;
38   {
39     int len;
40 !   char *pmt, *p;
41   
42     rl_save_prompt ();
43   
44 !   /* We've saved the prompt, and can do anything with the various prompt
45 !      strings we need before they're restored.  We want the unexpanded
46 !      portion of the prompt string after any final newline. */
47 !   p = rl_prompt ? strrchr (rl_prompt, '\n') : 0;
48 !   if (p == 0)
49       {
50         len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
51         pmt = (char *)xmalloc (len + 2);
52 ***************
53 *** 1998,2016 ****
54       }
55     else
56       {
57 !       len = *saved_local_prompt ? strlen (saved_local_prompt) : 0;
58         pmt = (char *)xmalloc (len + 2);
59         if (len)
60 !       strcpy (pmt, saved_local_prompt);
61         pmt[len] = pchar;
62         pmt[len+1] = '\0';
63 !       local_prompt = savestring (pmt);
64 !       prompt_last_invisible = saved_last_invisible;
65 !       prompt_visible_length = saved_visible_length + 1;
66 !     }
67   
68     prompt_physical_chars = saved_physical_chars + 1;
69
70     return pmt;
71   }
72   
73 --- 2017,2033 ----
74       }
75     else
76       {
77 !       p++;
78 !       len = strlen (p);
79         pmt = (char *)xmalloc (len + 2);
80         if (len)
81 !       strcpy (pmt, p);
82         pmt[len] = pchar;
83         pmt[len+1] = '\0';
84 !     }  
85   
86 +   /* will be overwritten by expand_prompt, called from rl_message */
87     prompt_physical_chars = saved_physical_chars + 1;
88     return pmt;
89   }
90