| @@ -1,783 +1,787 @@ | | | @@ -1,783 +1,787 @@ |
1 | $NetBSD: patch-an,v 1.5 2013/01/11 13:24:32 joerg Exp $ | | 1 | $NetBSD: patch-an,v 1.6 2014/09/23 22:37:29 jperkin Exp $ |
| | | 2 | |
| | | 3 | Don't include termcap.h on SunOS. |
2 | | | 4 | |
3 | --- readline/readline.c.orig 1995-02-24 21:20:03.000000000 +0000 | | 5 | --- readline/readline.c.orig 1995-02-24 21:20:03.000000000 +0000 |
4 | +++ readline/readline.c | | 6 | +++ readline/readline.c |
5 | @@ -38,17 +38,25 @@ static char *xmalloc (), *xrealloc (); | | 7 | @@ -38,17 +38,27 @@ static char *xmalloc (), *xrealloc (); |
6 | # endif | | 8 | # endif |
7 | #endif | | 9 | #endif |
8 | | | 10 | |
9 | +#include <unistd.h> | | 11 | +#include <unistd.h> |
| | | 12 | +#ifndef __sun |
10 | +#include <termcap.h> | | 13 | +#include <termcap.h> |
| | | 14 | +#endif |
11 | #include <stdio.h> | | 15 | #include <stdio.h> |
12 | #include <sys/types.h> | | 16 | #include <sys/types.h> |
13 | #include <fcntl.h> | | 17 | #include <fcntl.h> |
14 | #include <sys/file.h> | | 18 | #include <sys/file.h> |
15 | #include <signal.h> | | 19 | #include <signal.h> |
16 | +#include <stdlib.h> | | 20 | +#include <stdlib.h> |
17 | +#include <readline/readline.h> | | 21 | +#include <readline/readline.h> |
18 | | | 22 | |
19 | #if defined (HAVE_UNISTD_H) | | 23 | #if defined (HAVE_UNISTD_H) |
20 | # include <unistd.h> | | 24 | # include <unistd.h> |
21 | #endif | | 25 | #endif |
22 | | | 26 | |
23 | +#if !defined(__linux__) | | 27 | +#if !defined(__linux__) |
24 | #define NEW_TTY_DRIVER | | 28 | #define NEW_TTY_DRIVER |
25 | +#else | | 29 | +#else |
26 | +#define TERMIOS_TTY_DRIVER | | 30 | +#define TERMIOS_TTY_DRIVER |
27 | +#endif | | 31 | +#endif |
28 | #define HAVE_BSD_SIGNALS | | 32 | #define HAVE_BSD_SIGNALS |
29 | /* #define USE_XON_XOFF */ | | 33 | /* #define USE_XON_XOFF */ |
30 | | | 34 | |
31 | @@ -80,6 +88,10 @@ static char *xmalloc (), *xrealloc (); | | 35 | @@ -80,6 +90,10 @@ static char *xmalloc (), *xrealloc (); |
32 | # if !defined (O_NDELAY) | | 36 | # if !defined (O_NDELAY) |
33 | # define O_NDELAY O_NONBLOCK /* Posix-style non-blocking i/o */ | | 37 | # define O_NDELAY O_NONBLOCK /* Posix-style non-blocking i/o */ |
34 | # endif /* O_NDELAY */ | | 38 | # endif /* O_NDELAY */ |
35 | +#else | | 39 | +#else |
36 | +# ifdef TERMIOS_TTY_DRIVER | | 40 | +# ifdef TERMIOS_TTY_DRIVER |
37 | +# include <termios.h> | | 41 | +# include <termios.h> |
38 | +# endif /* !TERMIOS_MISSING */ | | 42 | +# endif /* !TERMIOS_MISSING */ |
39 | #endif /* _POSIX_VERSION */ | | 43 | #endif /* _POSIX_VERSION */ |
40 | | | 44 | |
41 | /* Other (BSD) machines use sgtty. */ | | 45 | /* Other (BSD) machines use sgtty. */ |
42 | @@ -104,7 +116,6 @@ static char *xmalloc (), *xrealloc (); | | 46 | @@ -104,7 +118,6 @@ static char *xmalloc (), *xrealloc (); |
43 | #endif /* !NEW_TTY_DRIVER && !_POSIX_VDISABLE */ | | 47 | #endif /* !NEW_TTY_DRIVER && !_POSIX_VDISABLE */ |
44 | | | 48 | |
45 | #include <errno.h> | | 49 | #include <errno.h> |
46 | -extern int errno; | | 50 | -extern int errno; |
47 | | | 51 | |
48 | #include <setjmp.h> | | 52 | #include <setjmp.h> |
49 | #if defined (SHELL) | | 53 | #if defined (SHELL) |
50 | @@ -133,7 +144,7 @@ struct passwd *getpwuid (), *getpwent () | | 54 | @@ -133,7 +146,7 @@ struct passwd *getpwuid (), *getpwent () |
51 | # endif /* USGr3 */ | | 55 | # endif /* USGr3 */ |
52 | #endif /* USG && hpux */ | | 56 | #endif /* USG && hpux */ |
53 | | | 57 | |
54 | -#if defined (_POSIX_VERSION) || defined (USGr3) | | 58 | -#if defined (_POSIX_VERSION) || defined (USGr3) |
55 | +#if defined (_POSIX_VERSION) || defined (USGr3) || defined(__linux__) | | 59 | +#if defined (_POSIX_VERSION) || defined (USGr3) || defined(__linux__) |
56 | # include <dirent.h> | | 60 | # include <dirent.h> |
57 | # define direct dirent | | 61 | # define direct dirent |
58 | # if defined (_POSIX_VERSION) | | 62 | # if defined (_POSIX_VERSION) |
59 | @@ -204,10 +215,13 @@ extern char *index (); | | 63 | @@ -204,10 +217,13 @@ extern char *index (); |
60 | extern char *getenv (); | | 64 | extern char *getenv (); |
61 | extern char *tilde_expand (); | | 65 | extern char *tilde_expand (); |
62 | | | 66 | |
63 | -static update_line (); | | 67 | -static update_line (); |
64 | +static void update_line (char *, char *, int); | | 68 | +static void update_line (char *, char *, int); |
65 | static void output_character_function (); | | 69 | static void output_character_function (); |
66 | -static delete_chars (); | | 70 | -static delete_chars (); |
67 | +static void delete_chars (int); | | 71 | +static void delete_chars (int); |
68 | static insert_some_chars (); | | 72 | static insert_some_chars (); |
69 | +static void move_vert (int to); | | 73 | +static void move_vert (int to); |
70 | +static void rl_digit_loop (void); | | 74 | +static void rl_digit_loop (void); |
71 | +static void free_history_entry(HIST_ENTRY *entry); | | 75 | +static void free_history_entry(HIST_ENTRY *entry); |
72 | | | 76 | |
73 | #if defined (VOID_SIGHANDLER) | | 77 | #if defined (VOID_SIGHANDLER) |
74 | # define sighandler void | | 78 | # define sighandler void |
75 | @@ -280,7 +294,7 @@ static jmp_buf readline_top_level; | | 79 | @@ -280,7 +296,7 @@ static jmp_buf readline_top_level; |
76 | static FILE *in_stream, *out_stream; | | 80 | static FILE *in_stream, *out_stream; |
77 | | | 81 | |
78 | /* The names of the streams that we do input and output to. */ | | 82 | /* The names of the streams that we do input and output to. */ |
79 | -FILE *rl_instream = stdin, *rl_outstream = stdout; | | 83 | -FILE *rl_instream = stdin, *rl_outstream = stdout; |
80 | +FILE *rl_instream = NULL, *rl_outstream = NULL; | | 84 | +FILE *rl_instream = NULL, *rl_outstream = NULL; |
81 | | | 85 | |
82 | /* Non-zero means echo characters as they are read. */ | | 86 | /* Non-zero means echo characters as they are read. */ |
83 | int readline_echoing_p = 1; | | 87 | int readline_echoing_p = 1; |
84 | @@ -335,6 +349,8 @@ static int stricmp (), strnicmp (); | | 88 | @@ -335,6 +351,8 @@ static int stricmp (), strnicmp (); |
85 | /* Non-zero means to save keys that we dispatch on in a kbd macro. */ | | 89 | /* Non-zero means to save keys that we dispatch on in a kbd macro. */ |
86 | static int defining_kbd_macro = 0; | | 90 | static int defining_kbd_macro = 0; |
87 | | | 91 | |
88 | +static void init_terminal_io (char *terminal_name); | | 92 | +static void init_terminal_io (char *terminal_name); |
89 | + | | 93 | + |
90 | | | 94 | |
91 | /* **************************************************************** */ | | 95 | /* **************************************************************** */ |
92 | /* */ | | 96 | /* */ |
93 | @@ -744,7 +760,7 @@ rl_unget_char (key) | | 97 | @@ -744,7 +762,7 @@ rl_unget_char (key) |
94 | | | 98 | |
95 | /* If a character is available to be read, then read it | | 99 | /* If a character is available to be read, then read it |
96 | and stuff it into IBUFFER. Otherwise, just return. */ | | 100 | and stuff it into IBUFFER. Otherwise, just return. */ |
97 | -rl_gather_tyi () | | 101 | -rl_gather_tyi () |
98 | +static void rl_gather_tyi (void) | | 102 | +static void rl_gather_tyi (void) |
99 | { | | 103 | { |
100 | int tty = fileno (in_stream); | | 104 | int tty = fileno (in_stream); |
101 | register int tem, result = -1; | | 105 | register int tem, result = -1; |
102 | @@ -861,7 +877,7 @@ rl_dispatch (key, map) | | 106 | @@ -861,7 +879,7 @@ rl_dispatch (key, map) |
103 | } | | 107 | } |
104 | else | | 108 | else |
105 | ding (); | | 109 | ding (); |
106 | - return; | | 110 | - return; |
107 | + return 0; | | 111 | + return 0; |
108 | } | | 112 | } |
109 | | | 113 | |
110 | switch (map[key].type) | | 114 | switch (map[key].type) |
111 | @@ -876,7 +892,7 @@ rl_dispatch (key, map) | | 115 | @@ -876,7 +894,7 @@ rl_dispatch (key, map) |
112 | if (func == rl_do_lowercase_version) | | 116 | if (func == rl_do_lowercase_version) |
113 | { | | 117 | { |
114 | rl_dispatch (to_lower (key), map); | | 118 | rl_dispatch (to_lower (key), map); |
115 | - return; | | 119 | - return; |
116 | + return 0; | | 120 | + return 0; |
117 | } | | 121 | } |
118 | | | 122 | |
119 | (*map[key].function)(rl_numeric_arg * rl_arg_sign, key); | | 123 | (*map[key].function)(rl_numeric_arg * rl_arg_sign, key); |
120 | @@ -890,7 +906,7 @@ rl_dispatch (key, map) | | 124 | @@ -890,7 +908,7 @@ rl_dispatch (key, map) |
121 | else | | 125 | else |
122 | { | | 126 | { |
123 | rl_abort (); | | 127 | rl_abort (); |
124 | - return; | | 128 | - return; |
125 | + return 0; | | 129 | + return 0; |
126 | } | | 130 | } |
127 | } | | 131 | } |
128 | break; | | 132 | break; |
129 | @@ -907,7 +923,7 @@ rl_dispatch (key, map) | | 133 | @@ -907,7 +925,7 @@ rl_dispatch (key, map) |
130 | else | | 134 | else |
131 | { | | 135 | { |
132 | rl_abort (); | | 136 | rl_abort (); |
133 | - return; | | 137 | - return; |
134 | + return 0; | | 138 | + return 0; |
135 | } | | 139 | } |
136 | break; | | 140 | break; |
137 | | | 141 | |
138 | @@ -918,10 +934,11 @@ rl_dispatch (key, map) | | 142 | @@ -918,10 +936,11 @@ rl_dispatch (key, map) |
139 | | | 143 | |
140 | macro = savestring ((char *)map[key].function); | | 144 | macro = savestring ((char *)map[key].function); |
141 | with_macro_input (macro); | | 145 | with_macro_input (macro); |
142 | - return; | | 146 | - return; |
143 | + return 0; | | 147 | + return 0; |
144 | } | | 148 | } |
145 | break; | | 149 | break; |
146 | } | | 150 | } |
147 | + return 0; | | 151 | + return 0; |
148 | } | | 152 | } |
149 | | | 153 | |
150 | | | 154 | |
151 | @@ -1152,6 +1169,8 @@ readline_initialize_everything () | | 155 | @@ -1152,6 +1171,8 @@ readline_initialize_everything () |
152 | { | | 156 | { |
153 | /* Find out if we are running in Emacs. */ | | 157 | /* Find out if we are running in Emacs. */ |
154 | running_in_emacs = getenv ("EMACS"); | | 158 | running_in_emacs = getenv ("EMACS"); |
155 | + rl_instream = stdin; | | 159 | + rl_instream = stdin; |
156 | + rl_outstream = stdout; | | 160 | + rl_outstream = stdout; |
157 | | | 161 | |
158 | /* Allocate data structures. */ | | 162 | /* Allocate data structures. */ |
159 | if (!rl_line_buffer) | | 163 | if (!rl_line_buffer) |
160 | @@ -1320,7 +1339,7 @@ rl_universal_argument () | | 164 | @@ -1320,7 +1341,7 @@ rl_universal_argument () |
161 | rl_digit_loop (); | | 165 | rl_digit_loop (); |
162 | } | | 166 | } |
163 | | | 167 | |
164 | -rl_digit_loop () | | 168 | -rl_digit_loop () |
165 | +static void rl_digit_loop (void) | | 169 | +static void rl_digit_loop (void) |
166 | { | | 170 | { |
167 | int key, c; | | 171 | int key, c; |
168 | while (1) | | 172 | while (1) |
169 | @@ -1450,7 +1469,7 @@ static void output_character_function () | | 173 | @@ -1450,7 +1471,7 @@ static void output_character_function () |
170 | static int compare_strings (); | | 174 | static int compare_strings (); |
171 | | | 175 | |
172 | /* Basic redisplay algorithm. */ | | 176 | /* Basic redisplay algorithm. */ |
173 | -rl_redisplay () | | 177 | -rl_redisplay () |
174 | +void rl_redisplay (void) | | 178 | +void rl_redisplay (void) |
175 | { | | 179 | { |
176 | register int in, out, c, linenum; | | 180 | register int in, out, c, linenum; |
177 | register char *line = invisible_line; | | 181 | register char *line = invisible_line; |
178 | @@ -1677,10 +1696,8 @@ new: eddie> Oh, my little buggy says to | | 182 | @@ -1677,10 +1698,8 @@ new: eddie> Oh, my little buggy says to |
179 | no differences, as well as for end of line additions must be handeled. | | 183 | no differences, as well as for end of line additions must be handeled. |
180 | | | 184 | |
181 | Could be made even smarter, but this works well enough */ | | 185 | Could be made even smarter, but this works well enough */ |
182 | -static | | 186 | -static |
183 | -update_line (old, new, current_line) | | 187 | -update_line (old, new, current_line) |
184 | - register char *old, *new; | | 188 | - register char *old, *new; |
185 | - int current_line; | | 189 | - int current_line; |
186 | +static void | | 190 | +static void |
187 | +update_line (char *old, char *new, int current_line) | | 191 | +update_line (char *old, char *new, int current_line) |
188 | { | | 192 | { |
189 | register char *ofd, *ols, *oe, *nfd, *nls, *ne; | | 193 | register char *ofd, *ols, *oe, *nfd, *nls, *ne; |
190 | int lendiff, wsatend; | | 194 | int lendiff, wsatend; |
191 | @@ -1872,8 +1889,7 @@ move_cursor_relative (new, data) | | 195 | @@ -1872,8 +1891,7 @@ move_cursor_relative (new, data) |
192 | } | | 196 | } |
193 | | | 197 | |
194 | /* PWP: move the cursor up or down. */ | | 198 | /* PWP: move the cursor up or down. */ |
195 | -move_vert (to) | | 199 | -move_vert (to) |
196 | - int to; | | 200 | - int to; |
197 | +static void move_vert (int to) | | 201 | +static void move_vert (int to) |
198 | { | | 202 | { |
199 | void output_character_function (); | | 203 | void output_character_function (); |
200 | register int delta, i; | | 204 | register int delta, i; |
201 | @@ -2018,8 +2034,7 @@ rl_reset_terminal (terminal_name) | | 205 | @@ -2018,8 +2036,7 @@ rl_reset_terminal (terminal_name) |
202 | init_terminal_io (terminal_name); | | 206 | init_terminal_io (terminal_name); |
203 | } | | 207 | } |
204 | | | 208 | |
205 | -init_terminal_io (terminal_name) | | 209 | -init_terminal_io (terminal_name) |
206 | - char *terminal_name; | | 210 | - char *terminal_name; |
207 | +static void init_terminal_io (char *terminal_name) | | 211 | +static void init_terminal_io (char *terminal_name) |
208 | { | | 212 | { |
209 | extern char *tgetstr (); | | 213 | extern char *tgetstr (); |
210 | char *term, *buffer; | | 214 | char *term, *buffer; |
211 | @@ -2158,9 +2173,8 @@ output_some_chars (string, count) | | 215 | @@ -2158,9 +2175,8 @@ output_some_chars (string, count) |
212 | } | | 216 | } |
213 | | | 217 | |
214 | /* Delete COUNT characters from the display line. */ | | 218 | /* Delete COUNT characters from the display line. */ |
215 | -static | | 219 | -static |
216 | -delete_chars (count) | | 220 | -delete_chars (count) |
217 | - int count; | | 221 | - int count; |
218 | +static void | | 222 | +static void |
219 | +delete_chars (int count) | | 223 | +delete_chars (int count) |
220 | { | | 224 | { |
221 | if (count > screenwidth) | | 225 | if (count > screenwidth) |
222 | return; | | 226 | return; |
223 | @@ -2505,7 +2519,11 @@ rl_prep_terminal () | | 227 | @@ -2505,7 +2521,11 @@ rl_prep_terminal () |
224 | | | 228 | |
225 | tio.c_lflag &= ~(ICANON | ECHO); | | 229 | tio.c_lflag &= ~(ICANON | ECHO); |
226 | | | 230 | |
227 | - if (otio.c_cc[VEOF] != _POSIX_VDISABLE) | | 231 | - if (otio.c_cc[VEOF] != _POSIX_VDISABLE) |
228 | +#ifdef ONLCR | | 232 | +#ifdef ONLCR |
229 | + tio.c_oflag |= OPOST|ONLCR; | | 233 | + tio.c_oflag |= OPOST|ONLCR; |
230 | +#endif | | 234 | +#endif |
231 | + | | 235 | + |
232 | + if ((unsigned char)otio.c_cc[VEOF] != (unsigned char)_POSIX_VDISABLE) | | 236 | + if ((unsigned char)otio.c_cc[VEOF] != (unsigned char)_POSIX_VDISABLE) |
233 | eof_char = otio.c_cc[VEOF]; | | 237 | eof_char = otio.c_cc[VEOF]; |
234 | | | 238 | |
235 | #if defined (USE_XON_XOFF) | | 239 | #if defined (USE_XON_XOFF) |
236 | @@ -2637,7 +2655,7 @@ alphabetic (c) | | 240 | @@ -2637,7 +2657,7 @@ alphabetic (c) |
237 | return (1); | | 241 | return (1); |
238 | | | 242 | |
239 | if (allow_pathname_alphabetic_chars) | | 243 | if (allow_pathname_alphabetic_chars) |
240 | - return ((int)rindex (pathname_alphabetic_chars, c)); | | 244 | - return ((int)rindex (pathname_alphabetic_chars, c)); |
241 | + return (rindex (pathname_alphabetic_chars, c) != NULL); | | 245 | + return (rindex (pathname_alphabetic_chars, c) != NULL); |
242 | else | | 246 | else |
243 | return (0); | | 247 | return (0); |
244 | } | | 248 | } |
245 | @@ -2845,12 +2863,13 @@ rl_forward (count) | | 249 | @@ -2845,12 +2865,13 @@ rl_forward (count) |
246 | #endif /* VI_MODE */ | | 250 | #endif /* VI_MODE */ |
247 | { | | 251 | { |
248 | ding (); | | 252 | ding (); |
249 | - return; | | 253 | - return; |
250 | + return 0; | | 254 | + return 0; |
251 | } | | 255 | } |
252 | else | | 256 | else |
253 | rl_point++; | | 257 | rl_point++; |
254 | --count; | | 258 | --count; |
255 | } | | 259 | } |
256 | + return 0; | | 260 | + return 0; |
257 | } | | 261 | } |
258 | | | 262 | |
259 | /* Move backward COUNT characters. */ | | 263 | /* Move backward COUNT characters. */ |
260 | @@ -2865,12 +2884,13 @@ rl_backward (count) | | 264 | @@ -2865,12 +2886,13 @@ rl_backward (count) |
261 | if (!rl_point) | | 265 | if (!rl_point) |
262 | { | | 266 | { |
263 | ding (); | | 267 | ding (); |
264 | - return; | | 268 | - return; |
265 | + return 0; | | 269 | + return 0; |
266 | } | | 270 | } |
267 | else | | 271 | else |
268 | --rl_point; | | 272 | --rl_point; |
269 | --count; | | 273 | --count; |
270 | } | | 274 | } |
271 | + return 0; | | 275 | + return 0; |
272 | } | | 276 | } |
273 | | | 277 | |
274 | /* Move to the beginning of the line. */ | | 278 | /* Move to the beginning of the line. */ |
275 | @@ -2894,13 +2914,13 @@ rl_forward_word (count) | | 279 | @@ -2894,13 +2916,13 @@ rl_forward_word (count) |
276 | if (count < 0) | | 280 | if (count < 0) |
277 | { | | 281 | { |
278 | rl_backward_word (-count); | | 282 | rl_backward_word (-count); |
279 | - return; | | 283 | - return; |
280 | + return 0; | | 284 | + return 0; |
281 | } | | 285 | } |
282 | | | 286 | |
283 | while (count) | | 287 | while (count) |
284 | { | | 288 | { |
285 | if (rl_point == rl_end) | | 289 | if (rl_point == rl_end) |
286 | - return; | | 290 | - return; |
287 | + return 0; | | 291 | + return 0; |
288 | | | 292 | |
289 | /* If we are not in a word, move forward until we are in one. | | 293 | /* If we are not in a word, move forward until we are in one. |
290 | Then, move forward until we hit a non-alphabetic character. */ | | 294 | Then, move forward until we hit a non-alphabetic character. */ |
291 | @@ -2913,7 +2933,7 @@ rl_forward_word (count) | | 295 | @@ -2913,7 +2935,7 @@ rl_forward_word (count) |
292 | if (alphabetic (c)) break; | | 296 | if (alphabetic (c)) break; |
293 | } | | 297 | } |
294 | } | | 298 | } |
295 | - if (rl_point == rl_end) return; | | 299 | - if (rl_point == rl_end) return; |
296 | + if (rl_point == rl_end) return 0; | | 300 | + if (rl_point == rl_end) return 0; |
297 | while (++rl_point < rl_end) | | 301 | while (++rl_point < rl_end) |
298 | { | | 302 | { |
299 | c = the_line[rl_point]; | | 303 | c = the_line[rl_point]; |
300 | @@ -2921,6 +2941,7 @@ rl_forward_word (count) | | 304 | @@ -2921,6 +2943,7 @@ rl_forward_word (count) |
301 | } | | 305 | } |
302 | --count; | | 306 | --count; |
303 | } | | 307 | } |
304 | + return 0; | | 308 | + return 0; |
305 | } | | 309 | } |
306 | | | 310 | |
307 | /* Move backward a word. We do what Emacs does. */ | | 311 | /* Move backward a word. We do what Emacs does. */ |
308 | @@ -2932,13 +2953,13 @@ rl_backward_word (count) | | 312 | @@ -2932,13 +2955,13 @@ rl_backward_word (count) |
309 | if (count < 0) | | 313 | if (count < 0) |
310 | { | | 314 | { |
311 | rl_forward_word (-count); | | 315 | rl_forward_word (-count); |
312 | - return; | | 316 | - return; |
313 | + return 0; | | 317 | + return 0; |
314 | } | | 318 | } |
315 | | | 319 | |
316 | while (count) | | 320 | while (count) |
317 | { | | 321 | { |
318 | if (!rl_point) | | 322 | if (!rl_point) |
319 | - return; | | 323 | - return; |
320 | + return 0; | | 324 | + return 0; |
321 | | | 325 | |
322 | /* Like rl_forward_word (), except that we look at the characters | | 326 | /* Like rl_forward_word (), except that we look at the characters |
323 | just before point. */ | | 327 | just before point. */ |
324 | @@ -2962,6 +2983,7 @@ rl_backward_word (count) | | 328 | @@ -2962,6 +2985,7 @@ rl_backward_word (count) |
325 | } | | 329 | } |
326 | --count; | | 330 | --count; |
327 | } | | 331 | } |
328 | + return 0; | | 332 | + return 0; |
329 | } | | 333 | } |
330 | | | 334 | |
331 | /* Clear the current line. Numeric argument to C-l does this. */ | | 335 | /* Clear the current line. Numeric argument to C-l does this. */ |
332 | @@ -2990,7 +3012,7 @@ rl_clear_screen () | | 336 | @@ -2990,7 +3014,7 @@ rl_clear_screen () |
333 | if (rl_explicit_arg) | | 337 | if (rl_explicit_arg) |
334 | { | | 338 | { |
335 | rl_refresh_line (); | | 339 | rl_refresh_line (); |
336 | - return; | | 340 | - return; |
337 | + return 0; | | 341 | + return 0; |
338 | } | | 342 | } |
339 | | | 343 | |
340 | if (term_clrpag) | | 344 | if (term_clrpag) |
341 | @@ -3000,6 +3022,7 @@ rl_clear_screen () | | 345 | @@ -3000,6 +3024,7 @@ rl_clear_screen () |
342 | | | 346 | |
343 | rl_forced_update_display (); | | 347 | rl_forced_update_display (); |
344 | rl_display_fixed = 1; | | 348 | rl_display_fixed = 1; |
345 | + return 0; | | 349 | + return 0; |
346 | } | | 350 | } |
347 | | | 351 | |
348 | rl_arrow_keys (count, c) | | 352 | rl_arrow_keys (count, c) |
349 | @@ -3047,7 +3070,7 @@ rl_insert (count, c) | | 353 | @@ -3047,7 +3072,7 @@ rl_insert (count, c) |
350 | char *string; | | 354 | char *string; |
351 | | | 355 | |
352 | if (count <= 0) | | 356 | if (count <= 0) |
353 | - return; | | 357 | - return; |
354 | + return 0; | | 358 | + return 0; |
355 | | | 359 | |
356 | /* If we can optimize, then do it. But don't let people crash | | 360 | /* If we can optimize, then do it. But don't let people crash |
357 | readline because of extra large arguments. */ | | 361 | readline because of extra large arguments. */ |
358 | @@ -3060,7 +3083,7 @@ rl_insert (count, c) | | 362 | @@ -3060,7 +3085,7 @@ rl_insert (count, c) |
359 | | | 363 | |
360 | string[i] = '\0'; | | 364 | string[i] = '\0'; |
361 | rl_insert_text (string); | | 365 | rl_insert_text (string); |
362 | - return; | | 366 | - return; |
363 | + return 0; | | 367 | + return 0; |
364 | } | | 368 | } |
365 | | | 369 | |
366 | if (count > 1024) | | 370 | if (count > 1024) |
367 | @@ -3079,7 +3102,7 @@ rl_insert (count, c) | | 371 | @@ -3079,7 +3104,7 @@ rl_insert (count, c) |
368 | rl_insert_text (string); | | 372 | rl_insert_text (string); |
369 | count -= decreaser; | | 373 | count -= decreaser; |
370 | } | | 374 | } |
371 | - return; | | 375 | - return; |
372 | + return 0; | | 376 | + return 0; |
373 | } | | 377 | } |
374 | | | 378 | |
375 | /* We are inserting a single character. | | 379 | /* We are inserting a single character. |
376 | @@ -3104,7 +3127,6 @@ rl_insert (count, c) | | 380 | @@ -3104,7 +3129,6 @@ rl_insert (count, c) |
377 | | | 381 | |
378 | string[i] = '\0'; | | 382 | string[i] = '\0'; |
379 | rl_insert_text (string); | | 383 | rl_insert_text (string); |
380 | - return; | | 384 | - return; |
381 | } | | 385 | } |
382 | else | | 386 | else |
383 | { | | 387 | { |
384 | @@ -3115,6 +3137,7 @@ rl_insert (count, c) | | 388 | @@ -3115,6 +3139,7 @@ rl_insert (count, c) |
385 | string[0] = c; | | 389 | string[0] = c; |
386 | rl_insert_text (string); | | 390 | rl_insert_text (string); |
387 | } | | 391 | } |
388 | + return 0; | | 392 | + return 0; |
389 | } | | 393 | } |
390 | | | 394 | |
391 | /* Insert the next typed character verbatim. */ | | 395 | /* Insert the next typed character verbatim. */ |
392 | @@ -3127,9 +3150,10 @@ rl_quoted_insert (count) | | 396 | @@ -3127,9 +3152,10 @@ rl_quoted_insert (count) |
393 | if (c==0x01) | | 397 | if (c==0x01) |
394 | { | | 398 | { |
395 | printf("\007"); | | 399 | printf("\007"); |
396 | - return; | | 400 | - return; |
397 | + return 0; | | 401 | + return 0; |
398 | } | | 402 | } |
399 | rl_insert (count, c); | | 403 | rl_insert (count, c); |
400 | + return 0; | | 404 | + return 0; |
401 | } | | 405 | } |
402 | | | 406 | |
403 | /* Insert a tab character. */ | | 407 | /* Insert a tab character. */ |
404 | @@ -3196,14 +3220,14 @@ rl_rubout (count) | | 408 | @@ -3196,14 +3222,14 @@ rl_rubout (count) |
405 | if (count < 0) | | 409 | if (count < 0) |
406 | { | | 410 | { |
407 | rl_delete (-count); | | 411 | rl_delete (-count); |
408 | - return; | | 412 | - return; |
409 | + return 0; | | 413 | + return 0; |
410 | } | | 414 | } |
411 | | | 415 | |
412 | if (!rl_point) | | 416 | if (!rl_point) |
413 | { | | 417 | { |
414 | ding (); | | 418 | ding (); |
415 | last_command_was_kill++; | | 419 | last_command_was_kill++; |
416 | - return; | | 420 | - return; |
417 | + return 0; | | 421 | + return 0; |
418 | } | | 422 | } |
419 | | | 423 | |
420 | if (count > 1) | | 424 | if (count > 1) |
421 | @@ -3228,6 +3252,7 @@ rl_rubout (count) | | 425 | @@ -3228,6 +3254,7 @@ rl_rubout (count) |
422 | rl_display_fixed++; | | 426 | rl_display_fixed++; |
423 | } | | 427 | } |
424 | } | | 428 | } |
425 | + return 0; | | 429 | + return 0; |
426 | } | | 430 | } |
427 | | | 431 | |
428 | /* Delete the character under the cursor. Given a numeric argument, | | 432 | /* Delete the character under the cursor. Given a numeric argument, |
429 | @@ -3238,13 +3263,13 @@ rl_delete (count, invoking_key) | | 433 | @@ -3238,13 +3265,13 @@ rl_delete (count, invoking_key) |
430 | if (count < 0) | | 434 | if (count < 0) |
431 | { | | 435 | { |
432 | rl_rubout (-count); | | 436 | rl_rubout (-count); |
433 | - return; | | 437 | - return; |
434 | + return 0; | | 438 | + return 0; |
435 | } | | 439 | } |
436 | | | 440 | |
437 | if (rl_point == rl_end) | | 441 | if (rl_point == rl_end) |
438 | { | | 442 | { |
439 | ding (); | | 443 | ding (); |
440 | - return; | | 444 | - return; |
441 | + return 0; | | 445 | + return 0; |
442 | } | | 446 | } |
443 | | | 447 | |
444 | if (count > 1) | | 448 | if (count > 1) |
445 | @@ -3256,6 +3281,7 @@ rl_delete (count, invoking_key) | | 449 | @@ -3256,6 +3283,7 @@ rl_delete (count, invoking_key) |
446 | } | | 450 | } |
447 | else | | 451 | else |
448 | rl_delete_text (rl_point, rl_point + 1); | | 452 | rl_delete_text (rl_point, rl_point + 1); |
449 | + return 0; | | 453 | + return 0; |
450 | } | | 454 | } |
451 | | | 455 | |
452 | | | 456 | |
453 | @@ -3412,7 +3438,7 @@ rl_transpose_words (count) | | 457 | @@ -3412,7 +3440,7 @@ rl_transpose_words (count) |
454 | int w1_beg, w1_end, w2_beg, w2_end; | | 458 | int w1_beg, w1_end, w2_beg, w2_end; |
455 | int orig_point = rl_point; | | 459 | int orig_point = rl_point; |
456 | | | 460 | |
457 | - if (!count) return; | | 461 | - if (!count) return; |
458 | + if (!count) return 0; | | 462 | + if (!count) return 0; |
459 | | | 463 | |
460 | /* Find the two words. */ | | 464 | /* Find the two words. */ |
461 | rl_forward_word (count); | | 465 | rl_forward_word (count); |
462 | @@ -3429,7 +3455,7 @@ rl_transpose_words (count) | | 466 | @@ -3429,7 +3457,7 @@ rl_transpose_words (count) |
463 | { | | 467 | { |
464 | ding (); | | 468 | ding (); |
465 | rl_point = orig_point; | | 469 | rl_point = orig_point; |
466 | - return; | | 470 | - return; |
467 | + return 0; | | 471 | + return 0; |
468 | } | | 472 | } |
469 | | | 473 | |
470 | /* Get the text of the words. */ | | 474 | /* Get the text of the words. */ |
471 | @@ -3457,6 +3483,7 @@ rl_transpose_words (count) | | 475 | @@ -3457,6 +3485,7 @@ rl_transpose_words (count) |
472 | /* I think that does it. */ | | 476 | /* I think that does it. */ |
473 | rl_end_undo_group (); | | 477 | rl_end_undo_group (); |
474 | free (word1); free (word2); | | 478 | free (word1); free (word2); |
475 | + return 0; | | 479 | + return 0; |
476 | } | | 480 | } |
477 | | | 481 | |
478 | /* Transpose the characters at point. If point is at the end of the line, | | 482 | /* Transpose the characters at point. If point is at the end of the line, |
479 | @@ -3465,11 +3492,11 @@ rl_transpose_chars (count) | | 483 | @@ -3465,11 +3494,11 @@ rl_transpose_chars (count) |
480 | int count; | | 484 | int count; |
481 | { | | 485 | { |
482 | if (!count) | | 486 | if (!count) |
483 | - return; | | 487 | - return; |
484 | + return 0; | | 488 | + return 0; |
485 | | | 489 | |
486 | if (!rl_point || rl_end < 2) { | | 490 | if (!rl_point || rl_end < 2) { |
487 | ding (); | | 491 | ding (); |
488 | - return; | | 492 | - return; |
489 | + return 0; | | 493 | + return 0; |
490 | } | | 494 | } |
491 | | | 495 | |
492 | while (count) | | 496 | while (count) |
493 | @@ -3499,6 +3526,7 @@ rl_transpose_chars (count) | | 497 | @@ -3499,6 +3528,7 @@ rl_transpose_chars (count) |
494 | else | | 498 | else |
495 | count--; | | 499 | count--; |
496 | } | | 500 | } |
497 | + return 0; | | 501 | + return 0; |
498 | } | | 502 | } |
499 | | | 503 | |
500 | | | 504 | |
501 | @@ -3570,7 +3598,7 @@ Function *rl_completion_entry_function = | | 505 | @@ -3570,7 +3600,7 @@ Function *rl_completion_entry_function = |
502 | If this function exists and returns NULL then call the value of | | 506 | If this function exists and returns NULL then call the value of |
503 | rl_completion_entry_function to try to match, otherwise use the | | 507 | rl_completion_entry_function to try to match, otherwise use the |
504 | array of strings returned. */ | | 508 | array of strings returned. */ |
505 | -Function *rl_attempted_completion_function = (Function *)NULL; | | 509 | -Function *rl_attempted_completion_function = (Function *)NULL; |
506 | +CPPFunction *rl_attempted_completion_function = (CPPFunction *)NULL; | | 510 | +CPPFunction *rl_attempted_completion_function = (CPPFunction *)NULL; |
507 | | | 511 | |
508 | /* Local variable states what happened during the last completion attempt. */ | | 512 | /* Local variable states what happened during the last completion attempt. */ |
509 | static int completion_changed_buffer = 0; | | 513 | static int completion_changed_buffer = 0; |
510 | @@ -3706,8 +3734,7 @@ rl_complete_internal (what_to_do) | | 514 | @@ -3706,8 +3736,7 @@ rl_complete_internal (what_to_do) |
511 | variable rl_attempted_completion_function. */ | | 515 | variable rl_attempted_completion_function. */ |
512 | if (rl_attempted_completion_function) | | 516 | if (rl_attempted_completion_function) |
513 | { | | 517 | { |
514 | - matches = | | 518 | - matches = |
515 | - (char **)(*rl_attempted_completion_function) (text, start, end); | | 519 | - (char **)(*rl_attempted_completion_function) (text, start, end); |
516 | + matches = (*rl_attempted_completion_function) (text, start, end); | | 520 | + matches = (*rl_attempted_completion_function) (text, start, end); |
517 | | | 521 | |
518 | if (matches) | | 522 | if (matches) |
519 | { | | 523 | { |
520 | @@ -3760,8 +3787,7 @@ rl_complete_internal (what_to_do) | | 524 | @@ -3760,8 +3789,7 @@ rl_complete_internal (what_to_do) |
521 | /* We have marked all the dead slots with (char *)-1. | | 525 | /* We have marked all the dead slots with (char *)-1. |
522 | Copy all the non-dead entries into a new array. */ | | 526 | Copy all the non-dead entries into a new array. */ |
523 | { | | 527 | { |
524 | - char **temp_array = | | 528 | - char **temp_array = |
525 | - (char **)malloc ((3 + newlen) * sizeof (char *)); | | 529 | - (char **)malloc ((3 + newlen) * sizeof (char *)); |
526 | + char **temp_array = malloc ((3 + newlen) * sizeof (char *)); | | 530 | + char **temp_array = malloc ((3 + newlen) * sizeof (char *)); |
527 | | | 531 | |
528 | for (i = 1, j = 1; matches[i]; i++) | | 532 | for (i = 1, j = 1; matches[i]; i++) |
529 | { | | 533 | { |
530 | @@ -4236,7 +4262,7 @@ rl_revert_line () | | 534 | @@ -4236,7 +4264,7 @@ rl_revert_line () |
531 | /* Do some undoing of things that were done. */ | | 535 | /* Do some undoing of things that were done. */ |
532 | rl_undo_command (count) | | 536 | rl_undo_command (count) |
533 | { | | 537 | { |
534 | - if (count < 0) return; /* Nothing to do. */ | | 538 | - if (count < 0) return; /* Nothing to do. */ |
535 | + if (count < 0) return 0; /* Nothing to do. */ | | 539 | + if (count < 0) return 0; /* Nothing to do. */ |
536 | | | 540 | |
537 | while (count) | | 541 | while (count) |
538 | { | | 542 | { |
539 | @@ -4250,6 +4276,7 @@ rl_undo_command (count) | | 543 | @@ -4250,6 +4278,7 @@ rl_undo_command (count) |
540 | break; | | 544 | break; |
541 | } | | 545 | } |
542 | } | | 546 | } |
543 | + return 0; | | 547 | + return 0; |
544 | } | | 548 | } |
545 | | | 549 | |
546 | /* **************************************************************** */ | | 550 | /* **************************************************************** */ |
547 | @@ -4277,8 +4304,7 @@ start_using_history () | | 551 | @@ -4277,8 +4306,7 @@ start_using_history () |
548 | } | | 552 | } |
549 | | | 553 | |
550 | /* Free the contents (and containing structure) of a HIST_ENTRY. */ | | 554 | /* Free the contents (and containing structure) of a HIST_ENTRY. */ |
551 | -free_history_entry (entry) | | 555 | -free_history_entry (entry) |
552 | - HIST_ENTRY *entry; | | 556 | - HIST_ENTRY *entry; |
553 | +static void free_history_entry(HIST_ENTRY *entry) | | 557 | +static void free_history_entry(HIST_ENTRY *entry) |
554 | { | | 558 | { |
555 | if (!entry) return; | | 559 | if (!entry) return; |
556 | if (entry->line) | | 560 | if (entry->line) |
557 | @@ -4362,11 +4388,11 @@ rl_get_next_history (count) | | 561 | @@ -4362,11 +4390,11 @@ rl_get_next_history (count) |
558 | if (count < 0) | | 562 | if (count < 0) |
559 | { | | 563 | { |
560 | rl_get_previous_history (-count); | | 564 | rl_get_previous_history (-count); |
561 | - return; | | 565 | - return; |
562 | + return 0; | | 566 | + return 0; |
563 | } | | 567 | } |
564 | | | 568 | |
565 | if (!count) | | 569 | if (!count) |
566 | - return; | | 570 | - return; |
567 | + return 0; | | 571 | + return 0; |
568 | | | 572 | |
569 | maybe_replace_line (); | | 573 | maybe_replace_line (); |
570 | | | 574 | |
571 | @@ -4397,6 +4423,7 @@ rl_get_next_history (count) | | 575 | @@ -4397,6 +4425,7 @@ rl_get_next_history (count) |
572 | rl_point = 0; | | 576 | rl_point = 0; |
573 | #endif /* VI_MODE */ | | 577 | #endif /* VI_MODE */ |
574 | } | | 578 | } |
575 | + return 0; | | 579 | + return 0; |
576 | } | | 580 | } |
577 | | | 581 | |
578 | /* Get the previous item out of our interactive history, making it the current | | 582 | /* Get the previous item out of our interactive history, making it the current |
579 | @@ -4410,11 +4437,11 @@ rl_get_previous_history (count) | | 583 | @@ -4410,11 +4439,11 @@ rl_get_previous_history (count) |
580 | if (count < 0) | | 584 | if (count < 0) |
581 | { | | 585 | { |
582 | rl_get_next_history (-count); | | 586 | rl_get_next_history (-count); |
583 | - return; | | 587 | - return; |
584 | + return 0; | | 588 | + return 0; |
585 | } | | 589 | } |
586 | | | 590 | |
587 | if (!count) | | 591 | if (!count) |
588 | - return; | | 592 | - return; |
589 | + return 0; | | 593 | + return 0; |
590 | | | 594 | |
591 | /* If we don't have a line saved, then save this one. */ | | 595 | /* If we don't have a line saved, then save this one. */ |
592 | maybe_save_line (); | | 596 | maybe_save_line (); |
593 | @@ -4457,6 +4484,7 @@ rl_get_previous_history (count) | | 597 | @@ -4457,6 +4486,7 @@ rl_get_previous_history (count) |
594 | rl_point = 0; | | 598 | rl_point = 0; |
595 | #endif /* VI_MODE */ | | 599 | #endif /* VI_MODE */ |
596 | } | | 600 | } |
597 | + return 0; | | 601 | + return 0; |
598 | } | | 602 | } |
599 | | | 603 | |
600 | | | 604 | |
601 | @@ -4643,7 +4671,7 @@ rl_search_history (direction, invoking_k | | 605 | @@ -4643,7 +4673,7 @@ rl_search_history (direction, invoking_k |
602 | rl_point = orig_point; | | 606 | rl_point = orig_point; |
603 | rl_end = strlen (the_line); | | 607 | rl_end = strlen (the_line); |
604 | rl_clear_message (); | | 608 | rl_clear_message (); |
605 | - return; | | 609 | - return; |
606 | + return 0; | | 610 | + return 0; |
607 | | | 611 | |
608 | default: | | 612 | default: |
609 | if (c < 32 || c > 126) | | 613 | if (c < 32 || c > 126) |
610 | @@ -4779,6 +4807,7 @@ rl_search_history (direction, invoking_k | | 614 | @@ -4779,6 +4809,7 @@ rl_search_history (direction, invoking_k |
611 | rl_point = index; | | 615 | rl_point = index; |
612 | rl_clear_message (); | | 616 | rl_clear_message (); |
613 | } | | 617 | } |
614 | + return 0; | | 618 | + return 0; |
615 | } | | 619 | } |
616 | | | 620 | |
617 | /* Make C be the next command to be executed. */ | | 621 | /* Make C be the next command to be executed. */ |
618 | @@ -4831,7 +4860,7 @@ rl_kill_text (from, to) | | 622 | @@ -4831,7 +4862,7 @@ rl_kill_text (from, to) |
619 | { | | 623 | { |
620 | free (text); | | 624 | free (text); |
621 | last_command_was_kill++; | | 625 | last_command_was_kill++; |
622 | - return; | | 626 | - return; |
623 | + return 0; | | 627 | + return 0; |
624 | } | | 628 | } |
625 | | | 629 | |
626 | /* Delete the copied text from the line. */ | | 630 | /* Delete the copied text from the line. */ |
627 | @@ -4902,6 +4931,7 @@ rl_kill_text (from, to) | | 631 | @@ -4902,6 +4933,7 @@ rl_kill_text (from, to) |
628 | } | | 632 | } |
629 | rl_kill_index = slot; | | 633 | rl_kill_index = slot; |
630 | last_command_was_kill++; | | 634 | last_command_was_kill++; |
631 | + return 0; | | 635 | + return 0; |
632 | } | | 636 | } |
633 | | | 637 | |
634 | /* Now REMEMBER! In order to do prepending or appending correctly, kill | | 638 | /* Now REMEMBER! In order to do prepending or appending correctly, kill |
635 | @@ -5039,14 +5069,14 @@ rl_yank_nth_arg (count, ignore) | | 639 | @@ -5039,14 +5071,14 @@ rl_yank_nth_arg (count, ignore) |
636 | else | | 640 | else |
637 | { | | 641 | { |
638 | ding (); | | 642 | ding (); |
639 | - return; | | 643 | - return; |
640 | + return 0; | | 644 | + return 0; |
641 | } | | 645 | } |
642 | | | 646 | |
643 | arg = history_arg_extract (count, count, entry->line); | | 647 | arg = history_arg_extract (count, count, entry->line); |
644 | if (!arg || !*arg) | | 648 | if (!arg || !*arg) |
645 | { | | 649 | { |
646 | ding (); | | 650 | ding (); |
647 | - return; | | 651 | - return; |
648 | + return 0; | | 652 | + return 0; |
649 | } | | 653 | } |
650 | | | 654 | |
651 | rl_begin_undo_group (); | | 655 | rl_begin_undo_group (); |
652 | @@ -5065,6 +5095,7 @@ rl_yank_nth_arg (count, ignore) | | 656 | @@ -5065,6 +5097,7 @@ rl_yank_nth_arg (count, ignore) |
653 | free (arg); | | 657 | free (arg); |
654 | | | 658 | |
655 | rl_end_undo_group (); | | 659 | rl_end_undo_group (); |
656 | + return 0; | | 660 | + return 0; |
657 | } | | 661 | } |
658 | | | 662 | |
659 | /* How to toggle back and forth between editing modes. */ | | 663 | /* How to toggle back and forth between editing modes. */ |
660 | @@ -5417,9 +5448,10 @@ rl_macro_bind (keyseq, macro, map) | | 664 | @@ -5417,9 +5450,10 @@ rl_macro_bind (keyseq, macro, map) |
661 | if (rl_translate_keyseq (macro, macro_keys, ¯o_keys_len)) | | 665 | if (rl_translate_keyseq (macro, macro_keys, ¯o_keys_len)) |
662 | { | | 666 | { |
663 | free (macro_keys); | | 667 | free (macro_keys); |
664 | - return; | | 668 | - return; |
665 | + return 0; | | 669 | + return 0; |
666 | } | | 670 | } |
667 | rl_generic_bind (ISMACR, keyseq, macro_keys, map); | | 671 | rl_generic_bind (ISMACR, keyseq, macro_keys, map); |
668 | + return 0; | | 672 | + return 0; |
669 | } | | 673 | } |
670 | | | 674 | |
671 | /* Bind the key sequence represented by the string KEYSEQ to | | 675 | /* Bind the key sequence represented by the string KEYSEQ to |
672 | @@ -5441,7 +5473,7 @@ rl_generic_bind (type, keyseq, data, map | | 676 | @@ -5441,7 +5475,7 @@ rl_generic_bind (type, keyseq, data, map |
673 | { | | 677 | { |
674 | if (type == ISMACR) | | 678 | if (type == ISMACR) |
675 | free (data); | | 679 | free (data); |
676 | - return; | | 680 | - return; |
677 | + return 0; | | 681 | + return 0; |
678 | } | | 682 | } |
679 | | | 683 | |
680 | keys = (char *)alloca (1 + (2 * strlen (keyseq))); | | 684 | keys = (char *)alloca (1 + (2 * strlen (keyseq))); |
681 | @@ -5450,7 +5482,7 @@ rl_generic_bind (type, keyseq, data, map | | 685 | @@ -5450,7 +5484,7 @@ rl_generic_bind (type, keyseq, data, map |
682 | of characters. Stuff the characters into ARRAY, and the | | 686 | of characters. Stuff the characters into ARRAY, and the |
683 | length of ARRAY into LENGTH. */ | | 687 | length of ARRAY into LENGTH. */ |
684 | if (rl_translate_keyseq (keyseq, keys, &keys_len)) | | 688 | if (rl_translate_keyseq (keyseq, keys, &keys_len)) |
685 | - return; | | 689 | - return; |
686 | + return 0; | | 690 | + return 0; |
687 | | | 691 | |
688 | /* Bind keys, making new keymaps as necessary. */ | | 692 | /* Bind keys, making new keymaps as necessary. */ |
689 | for (i = 0; i < keys_len; i++) | | 693 | for (i = 0; i < keys_len; i++) |
690 | @@ -5476,6 +5508,7 @@ rl_generic_bind (type, keyseq, data, map | | 694 | @@ -5476,6 +5510,7 @@ rl_generic_bind (type, keyseq, data, map |
691 | map[keys[i]].type = type; | | 695 | map[keys[i]].type = type; |
692 | } | | 696 | } |
693 | } | | 697 | } |
694 | + return 0; | | 698 | + return 0; |
695 | } | | 699 | } |
696 | | | 700 | |
697 | /* Translate the ASCII representation of SEQ, stuffing the | | 701 | /* Translate the ASCII representation of SEQ, stuffing the |
698 | @@ -5661,7 +5694,7 @@ parser_if (args) | | 702 | @@ -5661,7 +5696,7 @@ parser_if (args) |
699 | /* If parsing is turned off, then nothing can turn it back on except | | 703 | /* If parsing is turned off, then nothing can turn it back on except |
700 | for finding the matching endif. In that case, return right now. */ | | 704 | for finding the matching endif. In that case, return right now. */ |
701 | if (parsing_conditionalized_out) | | 705 | if (parsing_conditionalized_out) |
702 | - return; | | 706 | - return; |
703 | + return 0; | | 707 | + return 0; |
704 | | | 708 | |
705 | /* Isolate first argument. */ | | 709 | /* Isolate first argument. */ |
706 | for (i = 0; args[i] && !whitespace (args[i]); i++); | | 710 | for (i = 0; args[i] && !whitespace (args[i]); i++); |
707 | @@ -5713,6 +5746,7 @@ parser_if (args) | | 711 | @@ -5713,6 +5748,7 @@ parser_if (args) |
708 | parsing_conditionalized_out = 0; | | 712 | parsing_conditionalized_out = 0; |
709 | else | | 713 | else |
710 | parsing_conditionalized_out = 1; | | 714 | parsing_conditionalized_out = 1; |
711 | + return 0; | | 715 | + return 0; |
712 | } | | 716 | } |
713 | | | 717 | |
714 | /* Invert the current parser state if there is anything on the stack. */ | | 718 | /* Invert the current parser state if there is anything on the stack. */ |
715 | @@ -5724,17 +5758,18 @@ parser_else (args) | | 719 | @@ -5724,17 +5760,18 @@ parser_else (args) |
716 | if (!if_stack_depth) | | 720 | if (!if_stack_depth) |
717 | { | | 721 | { |
718 | /* Error message? */ | | 722 | /* Error message? */ |
719 | - return; | | 723 | - return; |
720 | + return 0; | | 724 | + return 0; |
721 | } | | 725 | } |
722 | | | 726 | |
723 | /* Check the previous (n - 1) levels of the stack to make sure that | | 727 | /* Check the previous (n - 1) levels of the stack to make sure that |
724 | we haven't previously turned off parsing. */ | | 728 | we haven't previously turned off parsing. */ |
725 | for (i = 0; i < if_stack_depth - 1; i++) | | 729 | for (i = 0; i < if_stack_depth - 1; i++) |
726 | if (if_stack[i] == 1) | | 730 | if (if_stack[i] == 1) |
727 | - return; | | 731 | - return; |
728 | + return 0; | | 732 | + return 0; |
729 | | | 733 | |
730 | /* Invert the state of parsing if at top level. */ | | 734 | /* Invert the state of parsing if at top level. */ |
731 | parsing_conditionalized_out = !parsing_conditionalized_out; | | 735 | parsing_conditionalized_out = !parsing_conditionalized_out; |
732 | + return 0; | | 736 | + return 0; |
733 | } | | 737 | } |
734 | | | 738 | |
735 | /* Terminate a conditional, popping the value of | | 739 | /* Terminate a conditional, popping the value of |
736 | @@ -5819,18 +5854,18 @@ rl_parse_and_bind (string) | | 740 | @@ -5819,18 +5856,18 @@ rl_parse_and_bind (string) |
737 | string++; | | 741 | string++; |
738 | | | 742 | |
739 | if (!string || !*string || *string == '#') | | 743 | if (!string || !*string || *string == '#') |
740 | - return; | | 744 | - return; |
741 | + return 0; | | 745 | + return 0; |
742 | | | 746 | |
743 | /* If this is a parser directive, act on it. */ | | 747 | /* If this is a parser directive, act on it. */ |
744 | if (*string == '$') | | 748 | if (*string == '$') |
745 | { | | 749 | { |
746 | handle_parser_directive (&string[1]); | | 750 | handle_parser_directive (&string[1]); |
747 | - return; | | 751 | - return; |
748 | + return 0; | | 752 | + return 0; |
749 | } | | 753 | } |
750 | | | 754 | |
751 | /* If we are supposed to be skipping parsing right now, then do it. */ | | 755 | /* If we are supposed to be skipping parsing right now, then do it. */ |
752 | if (parsing_conditionalized_out) | | 756 | if (parsing_conditionalized_out) |
753 | - return; | | 757 | - return; |
754 | + return 0; | | 758 | + return 0; |
755 | | | 759 | |
756 | i = 0; | | 760 | i = 0; |
757 | /* If this keyname is a complex key expression surrounded by quotes, | | 761 | /* If this keyname is a complex key expression surrounded by quotes, |
758 | @@ -5868,7 +5903,7 @@ rl_parse_and_bind (string) | | 762 | @@ -5868,7 +5905,7 @@ rl_parse_and_bind (string) |
759 | while (*value && whitespace (*value)) value++; | | 763 | while (*value && whitespace (*value)) value++; |
760 | | | 764 | |
761 | rl_variable_bind (var, value); | | 765 | rl_variable_bind (var, value); |
762 | - return; | | 766 | - return; |
763 | + return 0; | | 767 | + return 0; |
764 | } | | 768 | } |
765 | | | 769 | |
766 | /* Skip any whitespace between keyname and funname. */ | | 770 | /* Skip any whitespace between keyname and funname. */ |
767 | @@ -5928,7 +5963,7 @@ rl_parse_and_bind (string) | | 771 | @@ -5928,7 +5965,7 @@ rl_parse_and_bind (string) |
768 | else | | 772 | else |
769 | rl_set_key (seq, rl_named_function (funname), keymap); | | 773 | rl_set_key (seq, rl_named_function (funname), keymap); |
770 | | | 774 | |
771 | - return; | | 775 | - return; |
772 | + return 0; | | 776 | + return 0; |
773 | } | | 777 | } |
774 | | | 778 | |
775 | /* Get the actual character we want to deal with. */ | | 779 | /* Get the actual character we want to deal with. */ |
776 | @@ -5972,6 +6007,7 @@ rl_parse_and_bind (string) | | 780 | @@ -5972,6 +6009,7 @@ rl_parse_and_bind (string) |
777 | #endif /* PREFIX_META_HACK */ | | 781 | #endif /* PREFIX_META_HACK */ |
778 | else | | 782 | else |
779 | rl_bind_key (key, rl_named_function (funname)); | | 783 | rl_bind_key (key, rl_named_function (funname)); |
780 | + return 0; | | 784 | + return 0; |
781 | } | | 785 | } |
782 | | | 786 | |
783 | rl_variable_bind (name, value) | | 787 | rl_variable_bind (name, value) |