Attachment 'readline-5.2-msvc-2008.patch'
Download 1 diff -urN readline-32-src/ansi_stdlib.h readline-src/ansi_stdlib.h
2 --- readline-32-src/ansi_stdlib.h 2008-04-16 12:32:49.656250000 -0700
3 +++ readline-src/ansi_stdlib.h 2001-10-17 22:08:40.000000000 -0700
4 @@ -20,39 +20,35 @@
5 with Bash; see the file COPYING. If not, write to the Free Software
6 Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
7
8 -//********************* CHANGED commented everything *********************
9 #if !defined (_STDLIB_H_)
10 #define _STDLIB_H_ 1
11
12 -#include <stdlib.h>
13 +/* String conversion functions. */
14 +extern int atoi ();
15 +
16 +extern double atof ();
17 +extern double strtod ();
18 +
19 +/* Memory allocation functions. */
20 +/* Generic pointer type. */
21 +#ifndef PTR_T
22 +
23 +#if defined (__STDC__)
24 +# define PTR_T void *
25 +#else
26 +# define PTR_T char *
27 +#endif
28 +
29 +#endif /* PTR_T */
30 +
31 +extern PTR_T malloc ();
32 +extern PTR_T realloc ();
33 +extern void free ();
34 +
35 +/* Other miscellaneous functions. */
36 +extern void abort ();
37 +extern void exit ();
38 +extern char *getenv ();
39 +extern void qsort ();
40
41 -//
42 -///* String conversion functions. */
43 -//extern int atoi ();
44 -//
45 -//extern double atof ();
46 -//extern double strtod ();
47 -//
48 -///* Memory allocation functions. */
49 -///* Generic pointer type. */
50 -//#ifndef PTR_T
51 -//
52 -//#if defined (__STDC__)
53 -//# define PTR_T void *
54 -//#else
55 -//# define PTR_T char *
56 -//#endif
57 -//
58 -//#endif /* PTR_T */
59 -//
60 -//extern PTR_T malloc ();
61 -//extern PTR_T realloc ();
62 -//extern void free ();
63 -//
64 -///* Other miscellaneous functions. */
65 -//extern void abort ();
66 -//extern void exit ();
67 -//extern char *getenv ();
68 -//extern void qsort ();
69 -//
70 #endif /* _STDLIB_H */
71 diff -urN readline-32-src/bind.c readline-src/bind.c
72 --- readline-32-src/bind.c 2008-04-17 12:47:47.203125000 -0700
73 +++ readline-src/bind.c 2005-03-07 18:52:58.000000000 -0800
74 @@ -1368,123 +1368,43 @@
75
76 #define V_SPECIAL 0x1
77
78 -//************************* CHANGED *******************************************************
79 -//*************************C2099: intializer is not a constant*****************************
80 -//static struct {
81 -// const char *name;
82 -// int *value;
83 -// int flags;
84 -//} boolean_varlist [] = {
85 -// { "blink-matching-paren", &rl_blink_matching_paren, V_SPECIAL }, //
86 -// { "byte-oriented", &rl_byte_oriented, 0 },
87 -// { "completion-ignore-case", &_rl_completion_case_fold, 0 },
88 -// { "convert-meta", &_rl_convert_meta_chars_to_ascii, 0 },
89 -// { "disable-completion", &rl_inhibit_completion, 0 },
90 -// { "enable-keypad", &_rl_enable_keypad, 0 },
91 -// { "expand-tilde", &rl_complete_with_tilde_expansion, 0 },
92 -// { "history-preserve-point", &_rl_history_preserve_point, 0 },
93 -// { "horizontal-scroll-mode", &_rl_horizontal_scroll_mode, 0 },
94 -// { "input-meta", &_rl_meta_flag, 0 },
95 -// { "mark-directories", &_rl_complete_mark_directories, 0 },
96 -// { "mark-modified-lines", &_rl_mark_modified_lines, 0 },
97 -// { "mark-symlinked-directories", &_rl_complete_mark_symlink_dirs, 0 },
98 -// { "match-hidden-files", &_rl_match_hidden_files, 0 },
99 -// { "meta-flag", &_rl_meta_flag, 0 },
100 -// { "output-meta", &_rl_output_meta_chars, 0 },
101 -// { "page-completions", &_rl_page_completions, 0 },
102 -// { "prefer-visible-bell", &_rl_prefer_visible_bell, V_SPECIAL },
103 -// { "print-completions-horizontally", &_rl_print_completions_horizontally, 0 },
104 -// { "show-all-if-ambiguous", &_rl_complete_show_all, 0 },
105 -// { "show-all-if-unmodified", &_rl_complete_show_unmodified, 0 },
106 -//#if defined (VISIBLE_STATS)
107 -// { "visible-stats", &rl_visible_stats, 0 },
108 -//#endif /* VISIBLE_STATS */
109 -// { (char *)NULL, (int *)NULL }
110 -//};
111 -
112 -typedef struct {
113 +static struct {
114 const char *name;
115 int *value;
116 int flags;
117 -} aStruct;
118 -
119 +} boolean_varlist [] = {
120 + { "blink-matching-paren", &rl_blink_matching_paren, V_SPECIAL },
121 + { "byte-oriented", &rl_byte_oriented, 0 },
122 + { "completion-ignore-case", &_rl_completion_case_fold, 0 },
123 + { "convert-meta", &_rl_convert_meta_chars_to_ascii, 0 },
124 + { "disable-completion", &rl_inhibit_completion, 0 },
125 + { "enable-keypad", &_rl_enable_keypad, 0 },
126 + { "expand-tilde", &rl_complete_with_tilde_expansion, 0 },
127 + { "history-preserve-point", &_rl_history_preserve_point, 0 },
128 + { "horizontal-scroll-mode", &_rl_horizontal_scroll_mode, 0 },
129 + { "input-meta", &_rl_meta_flag, 0 },
130 + { "mark-directories", &_rl_complete_mark_directories, 0 },
131 + { "mark-modified-lines", &_rl_mark_modified_lines, 0 },
132 + { "mark-symlinked-directories", &_rl_complete_mark_symlink_dirs, 0 },
133 + { "match-hidden-files", &_rl_match_hidden_files, 0 },
134 + { "meta-flag", &_rl_meta_flag, 0 },
135 + { "output-meta", &_rl_output_meta_chars, 0 },
136 + { "page-completions", &_rl_page_completions, 0 },
137 + { "prefer-visible-bell", &_rl_prefer_visible_bell, V_SPECIAL },
138 + { "print-completions-horizontally", &_rl_print_completions_horizontally, 0 },
139 + { "show-all-if-ambiguous", &_rl_complete_show_all, 0 },
140 + { "show-all-if-unmodified", &_rl_complete_show_unmodified, 0 },
141 #if defined (VISIBLE_STATS)
142 - aStruct boolean_varlist[23];
143 -#else
144 - aStruct boolean_varlist[22];
145 + { "visible-stats", &rl_visible_stats, 0 },
146 #endif /* VISIBLE_STATS */
147 + { (char *)NULL, (int *)NULL }
148 +};
149
150 -void
151 -init_boolean_varlist()
152 -{
153 - register int i;
154 -
155 - boolean_varlist[0].name = "blink-matching-paren";
156 - boolean_varlist[0].value = &rl_blink_matching_paren;
157 - boolean_varlist[1].name = "byte-oriented";
158 - boolean_varlist[1].value = &rl_byte_oriented;
159 - boolean_varlist[2].name = "completion-ignore-case";
160 - boolean_varlist[2].value = &_rl_completion_case_fold;
161 - boolean_varlist[3].name = "convert-meta";
162 - boolean_varlist[3].value = &_rl_convert_meta_chars_to_ascii;
163 - boolean_varlist[4].name = "disable-completion";
164 - boolean_varlist[4].value = &rl_inhibit_completion;
165 - boolean_varlist[5].name = "enable-keypad";
166 - boolean_varlist[5].value = &_rl_enable_keypad;
167 - boolean_varlist[6].name = "expand-tilde";
168 - boolean_varlist[6].value = &rl_complete_with_tilde_expansion;
169 - boolean_varlist[7].name = "history-preserve-point";
170 - boolean_varlist[7].value = &_rl_history_preserve_point;
171 - boolean_varlist[8].name = "horizontal-scroll-mode";
172 - boolean_varlist[8].value = &_rl_horizontal_scroll_mode;
173 - boolean_varlist[9].name = "input-meta";
174 - boolean_varlist[9].value = &_rl_meta_flag;
175 - boolean_varlist[10].name = "mark-directories";
176 - boolean_varlist[10].value = &_rl_complete_mark_directories;
177 - boolean_varlist[11].name = "mark-modified-lines";
178 - boolean_varlist[11].value = &_rl_mark_modified_lines;
179 - boolean_varlist[12].name = "mark-symlinked-directories";
180 - boolean_varlist[12].value = &_rl_complete_mark_symlink_dirs;
181 - boolean_varlist[13].name = "match-hidden-files";
182 - boolean_varlist[13].value = &_rl_match_hidden_files;
183 - boolean_varlist[14].name = "meta-flag";
184 - boolean_varlist[14].value = &_rl_meta_flag;
185 - boolean_varlist[15].name = "output-meta";
186 - boolean_varlist[15].value = &_rl_output_meta_chars;
187 - boolean_varlist[16].name = "page-completions";
188 - boolean_varlist[16].value = &_rl_page_completions;
189 - boolean_varlist[17].name = "prefer-visible-bell";
190 - boolean_varlist[17].value = &_rl_prefer_visible_bell;
191 - boolean_varlist[18].name = "print-completions-horizontally";
192 - boolean_varlist[18].value = &_rl_print_completions_horizontally;
193 - boolean_varlist[19].name = "show-all-if-ambiguous";
194 - boolean_varlist[19].value = &_rl_complete_show_all;
195 - boolean_varlist[20].name = "show-all-if-unmodified";
196 - boolean_varlist[20].value = &_rl_complete_show_unmodified;
197 -
198 - #if defined (VISIBLE_STATS)
199 - boolean_varlist[21].name = (char *)NULL;
200 - boolean_varlist[21].value = (int *)NULL;
201 - #else
202 - boolean_varlist[21].name = "visible-stats";
203 - boolean_varlist[21].value = &rl_visible_stats;
204 - boolean_varlist[22].name = (char *)NULL;
205 - boolean_varlist[22].value = (int *)NULL;
206 - #endif /* VISIBLE_STATS */
207 -
208 - for (i = 0; boolean_varlist[i].name; i++)
209 - boolean_varlist[i].flags = 0;
210 -
211 - boolean_varlist[0].flags = V_SPECIAL;
212 - boolean_varlist[17].flags = V_SPECIAL;
213 -}
214 -
215 static int
216 find_boolean_var (name)
217 const char *name;
218 {
219 register int i;
220 - init_boolean_varlist();
221
222 for (i = 0; boolean_varlist[i].name; i++)
223 if (_rl_stricmp (name, boolean_varlist[i].name) == 0)
224 @@ -1500,8 +1420,7 @@
225 int i;
226 {
227 const char *name;
228 -
229 - init_boolean_varlist();
230 +
231 name = boolean_varlist[i].name;
232
233 if (_rl_stricmp (name, "blink-matching-paren") == 0)
234 @@ -1581,8 +1500,6 @@
235 register int i;
236 int v;
237
238 - init_boolean_varlist();
239 -
240 /* Check for simple variables first. */
241 i = find_boolean_var (name);
242 if (i >= 0)
243 @@ -2225,7 +2142,6 @@
244 int i;
245 const char *kname;
246
247 - init_boolean_varlist();
248 for (i = 0; boolean_varlist[i].name; i++)
249 {
250 if (print_readably)
251 diff -urN readline-32-src/complete.c readline-src/complete.c
252 --- readline-32-src/complete.c 2008-04-15 15:32:42.046875000 -0700
253 +++ readline-src/complete.c 2005-03-07 18:52:58.000000000 -0800
254 @@ -1891,8 +1891,7 @@
255 #else /* _WIN32 */
256 if (GetUserName (user_name, &user_len))
257 {
258 - //******************CHANGED************** used to be name_len
259 - if (namelen == 0 || (!strnicmp (username, user_name, namelen)))
260 + if (namelen == 0 || (!strnicmp (username, user_name, name_len)))
261 {
262 value = (char *)xmalloc (2 + strlen (user_name));
263 *value = *text;
264 diff -urN readline-32-src/histlib.h readline-src/histlib.h
265 --- readline-32-src/histlib.h 2008-04-15 13:14:20.921875000 -0700
266 +++ readline-src/histlib.h 2002-03-12 17:26:32.000000000 -0700
267 @@ -22,17 +22,11 @@
268 #if !defined (_HISTLIB_H_)
269 #define _HISTLIB_H_
270
271 -//#if defined (HAVE_STRING_H)
272 -//# include <string.h>
273 -//#else
274 -//# include <strings.h>
275 -//#endif /* !HAVE_STRING_H */
276 #if defined (HAVE_STRING_H)
277 # include <string.h>
278 -#endif
279 -#if defined (HAVE_STRINGS_H)
280 +#else
281 # include <strings.h>
282 -#endif
283 +#endif /* !HAVE_STRING_H */
284
285 #if !defined (STREQ)
286 #define STREQ(a, b) (((a)[0] == (b)[0]) && (strcmp ((a), (b)) == 0))
287 diff -urN readline-32-src/keymaps.c readline-src/keymaps.c
288 --- readline-32-src/keymaps.c 2008-04-15 17:12:54.312500000 -0700
289 +++ readline-src/keymaps.c 2002-10-07 19:25:52.000000000 -0700
290 @@ -35,8 +35,7 @@
291 #include "readline.h"
292 #include "rlconf.h"
293
294 -//*******************CHANGED COMMENTED BELOW****************************
295 -//#include "emacs_keymap.c"
296 +#include "emacs_keymap.c"
297
298 #if defined (VI_MODE)
299 #include "vi_keymap.c"
300 diff -urN readline-32-src/keymaps.h readline-src/keymaps.h
301 --- readline-32-src/keymaps.h 2008-04-16 13:40:33.328125000 -0700
302 +++ readline-src/keymaps.h 2001-11-20 17:42:50.000000000 -0800
303 @@ -67,8 +67,7 @@
304 #define ISMACR 2
305
306 extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap, emacs_meta_keymap, emacs_ctlx_keymap;
307 -//**************************CHANGED extern to static****************************
308 -static KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap;
309 +extern KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap;
310
311 /* Return a new, empty keymap.
312 Free it with free() when you are done. */
313 diff -urN readline-32-src/parens.c readline-src/parens.c
314 --- readline-32-src/parens.c 2008-04-15 15:46:22.406250000 -0700
315 +++ readline-src/parens.c 2005-03-07 18:52:58.000000000 -0800
316 @@ -53,19 +53,11 @@
317 # include <sys/select.h>
318 #endif
319
320 -//***********************CHANGED****************************
321 -//#if defined (HAVE_STRING_H)
322 -//# include <string.h>
323 -//#else /* !HAVE_STRING_H */
324 -//# include <strings.h>
325 -//#endif /* !HAVE_STRING_H */
326 -
327 #if defined (HAVE_STRING_H)
328 # include <string.h>
329 -#endif
330 -#if defined (HAVE_STRINGS_H)
331 +#else /* !HAVE_STRING_H */
332 # include <strings.h>
333 -#endif
334 +#endif /* !HAVE_STRING_H */
335
336 #if !defined (strchr) && !defined (__STDC__)
337 extern char *strchr (), *strrchr ();
338 diff -urN readline-32-src/readline.h readline-src/readline.h
339 --- readline-32-src/readline.h 2008-04-17 12:46:08.906250000 -0700
340 +++ readline-src/readline.h 2005-03-07 19:51:18.000000000 -0800
341 @@ -51,8 +51,6 @@
342 # define READLINE_DLL_IMPEXP
343 #endif
344
345 -#define READLINE_LIBRARY
346 -
347 #if defined (READLINE_LIBRARY)
348 # include "rlstdc.h"
349 # include "rltypedefs.h"
350 @@ -354,20 +352,17 @@
351 READLINE_DLL_IMPEXP int rl_read_init_file PARAMS((const char *));
352 READLINE_DLL_IMPEXP int rl_parse_and_bind PARAMS((char *));
353
354 -//***********************CHANGED commented below****************************
355 -//These decleartions already exsist in keymaps.h as extern.
356 /* Functions for manipulating keymaps. */
357 -//READLINE_DLL_IMPEXP Keymap rl_make_bare_keymap PARAMS((void));
358 -//READLINE_DLL_IMPEXP Keymap rl_copy_keymap PARAMS((Keymap));
359 -//READLINE_DLL_IMPEXP Keymap rl_make_keymap PARAMS((void));
360 -//READLINE_DLL_IMPEXP void rl_discard_keymap PARAMS((Keymap));
361 -//
362 -//READLINE_DLL_IMPEXP Keymap rl_get_keymap_by_name PARAMS((const char *));
363 -//READLINE_DLL_IMPEXP char *rl_get_keymap_name PARAMS((Keymap));
364 -//READLINE_DLL_IMPEXP void rl_set_keymap PARAMS((Keymap));
365 -//READLINE_DLL_IMPEXP Keymap rl_get_keymap PARAMS((void));
366 -
367 -///* Undocumented; used internally only. */
368 +READLINE_DLL_IMPEXP Keymap rl_make_bare_keymap PARAMS((void));
369 +READLINE_DLL_IMPEXP Keymap rl_copy_keymap PARAMS((Keymap));
370 +READLINE_DLL_IMPEXP Keymap rl_make_keymap PARAMS((void));
371 +READLINE_DLL_IMPEXP void rl_discard_keymap PARAMS((Keymap));
372 +
373 +READLINE_DLL_IMPEXP Keymap rl_get_keymap_by_name PARAMS((const char *));
374 +READLINE_DLL_IMPEXP char *rl_get_keymap_name PARAMS((Keymap));
375 +READLINE_DLL_IMPEXP void rl_set_keymap PARAMS((Keymap));
376 +READLINE_DLL_IMPEXP Keymap rl_get_keymap PARAMS((void));
377 +/* Undocumented; used internally only. */
378 READLINE_DLL_IMPEXP void rl_set_keymap_from_edit_mode PARAMS((void));
379 READLINE_DLL_IMPEXP char *rl_get_keymap_name_from_edit_mode PARAMS((void));
380
381 diff -urN readline-32-src/rldefs.h readline-src/rldefs.h
382 --- readline-32-src/rldefs.h 2008-04-15 15:46:19.406250000 -0700
383 +++ readline-src/rldefs.h 2005-03-07 19:52:08.000000000 -0800
384 @@ -50,18 +50,16 @@
385
386 /* Decide which flavor of the header file describing the C library
387 string functions to include and include it. */
388 -//**************CHANGED*****************
389 +
390 #if defined (HAVE_STRING_H)
391 # include <string.h>
392 -#endif
393 -#if defined (HAVE_STRINGS_H)
394 +#else /* !HAVE_STRING_H */
395 # include <strings.h>
396 -#endif
397 +#endif /* !HAVE_STRING_H */
398
399 -//**************CHANGED*****************
400 -//#if !defined (strchr) && !defined (__STDC__)
401 -//extern char *strchr (), *strrchr ();
402 -//#endif /* !strchr && !__STDC__ */
403 +#if !defined (strchr) && !defined (__STDC__)
404 +extern char *strchr (), *strrchr ();
405 +#endif /* !strchr && !__STDC__ */
406
407 #if defined (PREFER_STDARG)
408 # include <stdarg.h>
409 diff -urN readline-32-src/savestring.c readline-src/savestring.c
410 --- readline-32-src/savestring.c 2008-04-15 15:42:56.437500000 -0700
411 +++ readline-src/savestring.c 2003-12-09 21:06:02.000000000 -0800
412 @@ -21,8 +21,7 @@
413 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
414 #define READLINE_LIBRARY
415
416 -//*****************CHANGED commented out below************************
417 -//#include <config.h>
418 +#include <config.h>
419 #ifdef HAVE_STRING_H
420 # include <string.h>
421 #endif
422 diff -urN readline-32-src/shell.c readline-src/shell.c
423 --- readline-32-src/shell.c 2008-04-15 15:46:22.796875000 -0700
424 +++ readline-src/shell.c 2005-03-07 18:52:58.000000000 -0800
425 @@ -39,19 +39,11 @@
426 # include "ansi_stdlib.h"
427 #endif /* HAVE_STDLIB_H */
428
429 -//***********************CHANGED****************************
430 -//#if defined (HAVE_STRING_H)
431 -//# include <string.h>
432 -//#else
433 -//# include <strings.h>
434 -//#endif /* !HAVE_STRING_H */
435 -
436 #if defined (HAVE_STRING_H)
437 # include <string.h>
438 -#endif
439 -#if defined (HAVE_STRINGS_H)
440 +#else
441 # include <strings.h>
442 -#endif
443 +#endif /* !HAVE_STRING_H */
444
445 #if defined (HAVE_LIMITS_H)
446 # include <limits.h>
447 diff -urN readline-32-src/tilde.c readline-src/tilde.c
448 --- readline-32-src/tilde.c 2008-04-15 15:46:23.203125000 -0700
449 +++ readline-src/tilde.c 2005-03-07 18:52:58.000000000 -0800
450 @@ -30,19 +30,11 @@
451 # include <unistd.h>
452 #endif
453
454 -//***********************CHANGED****************************
455 -//#if defined (HAVE_STRING_H)
456 -//# include <string.h>
457 -//#else /* !HAVE_STRING_H */
458 -//# include <strings.h>
459 -//#endif /* !HAVE_STRING_H */
460 -
461 #if defined (HAVE_STRING_H)
462 # include <string.h>
463 -#endif
464 -#if defined (HAVE_STRINGS_H)
465 +#else /* !HAVE_STRING_H */
466 # include <strings.h>
467 -#endif
468 +#endif /* !HAVE_STRING_H */
469
470 #if defined (HAVE_STDLIB_H)
471 # include <stdlib.h>
472 diff -urN readline-32-src/tilde.h readline-src/tilde.h
473 --- readline-32-src/tilde.h 2008-04-15 15:43:57.390625000 -0700
474 +++ readline-src/tilde.h 2005-03-07 19:58:26.000000000 -0800
475 @@ -24,9 +24,6 @@
476 #if !defined (_TILDE_H_)
477 # define _TILDE_H_
478
479 -//**************************CHANGED add define below**********************
480 -#define READLINE_LIBRARY
481 -
482 #if defined READLINE_LIBRARY
483 # include "rlstdc.h"
484 #else
485 diff -urN readline-32-src/vi_keymap.c readline-src/vi_keymap.c
486 --- readline-32-src/vi_keymap.c 2008-04-17 13:44:16.843750000 -0700
487 +++ readline-src/vi_keymap.c 2001-11-29 17:05:36.000000000 -0800
488 @@ -310,6 +310,7 @@
489 #endif /* KEYMAP_SIZE > 128 */
490 };
491
492 +
493 KEYMAP_ENTRY_ARRAY vi_insertion_keymap = {
494 /* The regular control keys come first. */
495 { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-@ */
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.