diff options
Diffstat (limited to 'keymaps.c')
-rw-r--r-- | keymaps.c | 58 |
1 files changed, 6 insertions, 52 deletions
@@ -20,6 +20,10 @@ Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define READLINE_LIBRARY +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif + #if defined (HAVE_STDLIB_H) # include <stdlib.h> #else @@ -37,11 +41,7 @@ extern int rl_do_lowercase_version (); extern int rl_rubout (), rl_insert (); -#if defined (STATIC_MALLOC) -static char *xmalloc (), *xrealloc (); -#else extern char *xmalloc (), *xrealloc (); -#endif /* STATIC_MALLOC */ /* **************************************************************** */ /* */ @@ -101,11 +101,11 @@ rl_make_keymap () newmap = rl_make_bare_keymap (); /* All ASCII printing characters are self-inserting. */ - for (i = ' '; i < 126; i++) + for (i = ' '; i < 127; i++) newmap[i].function = rl_insert; newmap[TAB].function = rl_insert; - newmap[RUBOUT].function = rl_rubout; + newmap[RUBOUT].function = rl_rubout; /* RUBOUT == 127 */ newmap[CTRL('H')].function = rl_rubout; #if KEYMAP_SIZE > 128 @@ -148,49 +148,3 @@ rl_discard_keymap (map) } } } - -#if defined (STATIC_MALLOC) - -/* **************************************************************** */ -/* */ -/* xmalloc and xrealloc () */ -/* */ -/* **************************************************************** */ - -static void memory_error_and_abort (); - -static char * -xmalloc (bytes) - int bytes; -{ - char *temp = (char *)malloc (bytes); - - if (!temp) - memory_error_and_abort (); - return (temp); -} - -static char * -xrealloc (pointer, bytes) - char *pointer; - int bytes; -{ - char *temp; - - if (!pointer) - temp = (char *)malloc (bytes); - else - temp = (char *)realloc (pointer, bytes); - - if (!temp) - memory_error_and_abort (); - return (temp); -} - -static void -memory_error_and_abort () -{ - fprintf (stderr, "readline: Out of virtual memory!\n"); - abort (); -} -#endif /* STATIC_MALLOC */ |