Magellan Linux

Annotation of /trunk/readline/patches/readline-5.1-fixes-3.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (hide annotations) (download)
Tue May 8 20:52:56 2007 UTC (17 years, 1 month ago) by niro
File size: 3834 byte(s)
-import

1 niro 153 Submitted By: Matthew Burgess (matthew at linuxfromscratch dot org)
2     Date: 2006-03-17
3     Initial Package Version: 5.1
4     Origin: http://ftp.gnu.org/gnu/readline/readline-5.1-patches/
5     Upstream Status: From Upstream
6     Description: Contains Patch 001-004 from Upstream
7    
8     diff -Naur readline-5.1.orig/display.c readline-5.1/display.c
9     --- readline-5.1.orig/display.c 2005-11-30 19:05:02.000000000 +0000
10     +++ readline-5.1/display.c 2006-03-17 16:03:09.000000000 +0000
11     @@ -1983,11 +1983,15 @@
12     int pchar;
13     {
14     int len;
15     - char *pmt;
16     + char *pmt, *p;
17    
18     rl_save_prompt ();
19    
20     - if (saved_local_prompt == 0)
21     + /* We've saved the prompt, and can do anything with the various prompt
22     + strings we need before they're restored. We want the unexpanded
23     + portion of the prompt string after any final newline. */
24     + p = rl_prompt ? strrchr (rl_prompt, '\n') : 0;
25     + if (p == 0)
26     {
27     len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
28     pmt = (char *)xmalloc (len + 2);
29     @@ -1998,19 +2002,17 @@
30     }
31     else
32     {
33     - len = *saved_local_prompt ? strlen (saved_local_prompt) : 0;
34     + p++;
35     + len = strlen (p);
36     pmt = (char *)xmalloc (len + 2);
37     if (len)
38     - strcpy (pmt, saved_local_prompt);
39     + strcpy (pmt, p);
40     pmt[len] = pchar;
41     pmt[len+1] = '\0';
42     - local_prompt = savestring (pmt);
43     - prompt_last_invisible = saved_last_invisible;
44     - prompt_visible_length = saved_visible_length + 1;
45     - }
46     + }
47    
48     + /* will be overwritten by expand_prompt, called from rl_message */
49     prompt_physical_chars = saved_physical_chars + 1;
50     -
51     return pmt;
52     }
53    
54     diff -Naur readline-5.1.orig/readline.c readline-5.1/readline.c
55     --- readline-5.1.orig/readline.c 2005-07-05 02:29:35.000000000 +0000
56     +++ readline-5.1/readline.c 2006-03-17 16:03:05.000000000 +0000
57     @@ -282,6 +282,7 @@
58     {
59     FREE (rl_prompt);
60     rl_prompt = prompt ? savestring (prompt) : (char *)NULL;
61     + rl_display_prompt = rl_prompt ? rl_prompt : "";
62    
63     rl_visible_prompt_length = rl_expand_prompt (rl_prompt);
64     return 0;
65     @@ -714,7 +715,7 @@
66    
67     rl_dispatching = 1;
68     RL_SETSTATE(RL_STATE_DISPATCHING);
69     - r = (*map[key].function)(rl_numeric_arg * rl_arg_sign, key);
70     + (*map[key].function)(rl_numeric_arg * rl_arg_sign, key);
71     RL_UNSETSTATE(RL_STATE_DISPATCHING);
72     rl_dispatching = 0;
73    
74     diff -Naur readline-5.1.orig/terminal.c readline-5.1/terminal.c
75     --- readline-5.1.orig/terminal.c 2005-11-13 01:46:54.000000000 +0000
76     +++ readline-5.1/terminal.c 2006-03-17 16:03:02.000000000 +0000
77     @@ -122,7 +122,7 @@
78     static char *_rl_visible_bell;
79    
80     /* Non-zero means the terminal can auto-wrap lines. */
81     -int _rl_term_autowrap;
82     +int _rl_term_autowrap = -1;
83    
84     /* Non-zero means that this terminal has a meta key. */
85     static int term_has_meta;
86     @@ -274,6 +274,9 @@
87     _rl_set_screen_size (rows, cols)
88     int rows, cols;
89     {
90     + if (_rl_term_autowrap == -1)
91     + _rl_init_terminal_io (rl_terminal_name);
92     +
93     if (rows > 0)
94     _rl_screenheight = rows;
95     if (cols > 0)
96     diff -Naur readline-5.1.orig/text.c readline-5.1/text.c
97     --- readline-5.1.orig/text.c 2005-09-24 23:06:07.000000000 +0000
98     +++ readline-5.1/text.c 2006-03-17 16:02:58.000000000 +0000
99     @@ -1071,8 +1071,6 @@
100     rl_delete (count, key)
101     int count, key;
102     {
103     - int r;
104     -
105     if (count < 0)
106     return (_rl_rubout_char (-count, key));
107    
108     @@ -1090,17 +1088,17 @@
109     else
110     rl_forward_byte (count, key);
111    
112     - r = rl_kill_text (orig_point, rl_point);
113     + rl_kill_text (orig_point, rl_point);
114     rl_point = orig_point;
115     - return r;
116     }
117     else
118     {
119     int new_point;
120    
121     new_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO);
122     - return (rl_delete_text (rl_point, new_point));
123     + rl_delete_text (rl_point, new_point);
124     }
125     + return 0;
126     }
127    
128     /* Delete the character under the cursor, unless the insertion