From: Chet Ramey Date: Sun, 4 Dec 2011 03:45:06 +0000 (-0500) Subject: commit bash-20060209 snapshot X-Git-Tag: bash-3.2-alpha~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8d618825db361e503e9c91d38a459d74b431da7b;p=thirdparty%2Fbash.git commit bash-20060209 snapshot --- diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index f3fcc0f8a..eaebf0126 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -13046,3 +13046,40 @@ lib/readline/display.c PROMPT_ENDING_INDEX (worth checking) to compensate. Bug reported by Egmont Koblinger + 2/8 + --- +lib/readline/terminal.c + - call _emx_get_screensize with wr, wc like ioctl code for consistency + - new function, _win_get_screensize, gets screen dimensions using + standard Windows API for mingw32 (code from Denis Pilat) + - call _win_get_screensize from _rl_get_screen_size on mingw32 + +lib/readline/rlconf.h + - define SYS_INPUTRC (/etc/inputrc) as system-wide default inputrc + filename + +support/shobj-conf + - changes to make loadable builtins work on MacOS X 10.[34] + +builtins/pushd.def + - changes to make it work as a loadable builtin compiled with gcc4 + + 2/9 + --- +lib/readline/bind.c + - add SYS_INPUTRC as last-ditch default (if DEFAULT_INPUTRC does not + exist or can't be read) in rl_read_init_file + +lib/readline/doc/rluser.texi + - add description of /etc/inputrc as ultimate default startup file + + 2/10 + ---- +lib/readline/bind.c + - fix problem with rl_function_of_keyseq that returns a non-keymap + bound to a portion of the passed key sequence without processing + the entire thing. We can bind maps with existing non-map + functions using the ANYOTHERKEY binding code. + +variables.c + - shells running in posix mode do not set $HOME, as POSIX requires diff --git a/CWRU/CWRU.chlog~ b/CWRU/CWRU.chlog~ index 6c73f3dde..97457ffd2 100644 --- a/CWRU/CWRU.chlog~ +++ b/CWRU/CWRU.chlog~ @@ -13043,4 +13043,40 @@ lib/readline/display.c which caused a prompt with invisible characters to be redrawn one extra time in a multibyte locale. Change from <= to < fixes multibyte locale, but I added 1 to single-byte definition of - PROMPT_ENDING_INDEX (worth checking) to compensate + PROMPT_ENDING_INDEX (worth checking) to compensate. Bug reported + by Egmont Koblinger + + 2/8 + --- +lib/readline/terminal.c + - call _emx_get_screensize with wr, wc like ioctl code for consistency + - new function, _win_get_screensize, gets screen dimensions using + standard Windows API for mingw32 (code from Denis Pilat) + - call _win_get_screensize from _rl_get_screen_size on mingw32 + +lib/readline/rlconf.h + - define SYS_INPUTRC (/etc/inputrc) as system-wide default inputrc + filename + +support/shobj-conf + - changes to make loadable builtins work on MacOS X 10.[34] + +builtins/pushd.def + - changes to make it work as a loadable builtin compiled with gcc4 + + 2/9 + --- +lib/readline/bind.c + - add SYS_INPUTRC as last-ditch default (if DEFAULT_INPUTRC does not + exist or can't be read) in rl_read_init_file + +lib/readline/doc/rluser.texi + - add description of /etc/inputrc as ultimate default startup file + + 2/10 + ---- +lib/readline/bind.c + - fix problem with rl_function_of_keyseq that returns a non-keymap + bound to a portion of the passed key sequence without processing + the entire thing. We can bind maps with existing non-map + functions using the ANYOTHERKEY binding code. diff --git a/builtins/pushd.def b/builtins/pushd.def index 0978fc931..19a3ed466 100644 --- a/builtins/pushd.def +++ b/builtins/pushd.def @@ -657,7 +657,7 @@ get_directory_stack () } #ifdef LOADABLE_BUILTIN -static char * const dirs_doc[] = { +char * const dirs_doc[] = { N_("Display the list of currently remembered directories. Directories"), N_("find their way onto the list with the `pushd' command; you can get"), N_("back up through the list with the `popd' command."), @@ -678,7 +678,7 @@ static char * const dirs_doc[] = { (char *)NULL }; -static char * const pushd_doc[] = { +char * const pushd_doc[] = { N_("Adds a directory to the top of the directory stack, or rotates"), N_("the stack, making the new top of the stack the current working"), N_("directory. With no arguments, exchanges the top two directories."), @@ -701,7 +701,7 @@ static char * const pushd_doc[] = { (char *)NULL }; -static char * const popd_doc[] = { +char * const popd_doc[] = { N_("Removes entries from the directory stack. With no arguments,"), N_("removes the top directory from the stack, and cd's to the new"), N_("top directory."), diff --git a/lib/readline/bind.c b/lib/readline/bind.c index 0bebee742..6a3e48c41 100644 --- a/lib/readline/bind.c +++ b/lib/readline/bind.c @@ -691,7 +691,7 @@ rl_function_of_keyseq (keyseq, map, type) { register int i; - if (!map) + if (map == 0) map = _rl_keymap; for (i = 0; keyseq && keyseq[i]; i++) @@ -700,25 +700,27 @@ rl_function_of_keyseq (keyseq, map, type) if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii) { - if (map[ESC].type != ISKMAP) + if (map[ESC].type == ISKMAP) + { + map = FUNCTION_TO_KEYMAP (map, ESC); + ic = UNMETA (ic); + } + /* XXX - should we just return NULL here, since this obviously + doesn't match? */ + else { if (type) *type = map[ESC].type; return (map[ESC].function); } - else - { - map = FUNCTION_TO_KEYMAP (map, ESC); - ic = UNMETA (ic); - } } if (map[ic].type == ISKMAP) { /* If this is the last key in the key sequence, return the map. */ - if (!keyseq[i + 1]) + if (keyseq[i + 1] == '\0') { if (type) *type = ISKMAP; @@ -728,7 +730,12 @@ rl_function_of_keyseq (keyseq, map, type) else map = FUNCTION_TO_KEYMAP (map, ic); } - else + /* If we're not at the end of the key sequence, and the current key + is bound to something other than a keymap, then the entire key + sequence is not bound. */ + else if (map[ic].type != ISKMAP && keyseq[i+1]) + return ((rl_command_func_t *)NULL); + else /* map[ic].type != ISKMAP && keyseq[i+1] == 0 */ { if (type) *type = map[ic].type; @@ -810,6 +817,7 @@ rl_re_read_init_file (count, ignore) 1. the filename used for the previous call 2. the value of the shell variable `INPUTRC' 3. ~/.inputrc + 4. /etc/inputrc If the file existed and could be opened and read, 0 is returned, otherwise errno is returned. */ int @@ -818,17 +826,18 @@ rl_read_init_file (filename) { /* Default the filename. */ if (filename == 0) + filename = last_readline_init_file; + if (filename == 0) + filename = sh_get_env_value ("INPUTRC"); + if (filename == 0 || *filename == 0) { - filename = last_readline_init_file; - if (filename == 0) - filename = sh_get_env_value ("INPUTRC"); - if (filename == 0) - filename = DEFAULT_INPUTRC; + filename = DEFAULT_INPUTRC; + /* Try to read DEFAULT_INPUTRC; fall back to SYS_INPUTRC on failure */ + if (_rl_read_init_file (filename, 0) == 0) + return 0; + filename = SYS_INPUTRC; } - if (*filename == 0) - filename = DEFAULT_INPUTRC; - #if defined (__MSDOS__) if (_rl_read_init_file (filename, 0) == 0) return 0; diff --git a/lib/readline/bind.c~ b/lib/readline/bind.c~ index d4fe337dd..39acefbc0 100644 --- a/lib/readline/bind.c~ +++ b/lib/readline/bind.c~ @@ -1,6 +1,6 @@ /* bind.c -- key binding and startup file support for the readline library. */ -/* Copyright (C) 1987-2005 Free Software Foundation, Inc. +/* Copyright (C) 1987-2006 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -574,6 +574,11 @@ rl_untranslate_keyseq (seq) kseq[i++] = '-'; c = UNMETA (c); } + else if (c == ESC) + { + kseq[i++] = '\\'; + c = 'e'; + } else if (CTRL_CHAR (c)) { kseq[i++] = '\\'; @@ -622,7 +627,12 @@ _rl_untranslate_macro_value (seq) *r++ = '-'; c = UNMETA (c); } - else if (CTRL_CHAR (c) && c != ESC) + else if (c == ESC) + { + *r++ = '\\'; + c = 'e'; + } + else if (CTRL_CHAR (c)) { *r++ = '\\'; *r++ = 'C'; @@ -690,25 +700,27 @@ rl_function_of_keyseq (keyseq, map, type) if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii) { - if (map[ESC].type != ISKMAP) + if (map[ESC].type == ISKMAP) + { + map = FUNCTION_TO_KEYMAP (map, ESC); + ic = UNMETA (ic); + } + else if (map[ESC].type != ISKMAP && keyseq[i+1]) + return ((rl_command_func_t *)NULL); + else /* map[ESC].type != ISKMAP && keyseq[i+1] == 0 */ { if (type) *type = map[ESC].type; return (map[ESC].function); } - else - { - map = FUNCTION_TO_KEYMAP (map, ESC); - ic = UNMETA (ic); - } } if (map[ic].type == ISKMAP) { /* If this is the last key in the key sequence, return the map. */ - if (!keyseq[i + 1]) + if (keyseq[i + 1] == '\0') { if (type) *type = ISKMAP; @@ -718,7 +730,12 @@ rl_function_of_keyseq (keyseq, map, type) else map = FUNCTION_TO_KEYMAP (map, ic); } - else + /* If we're not at the end of the key sequence, and the current key + is bound to something other than a keymap, then the entire key + sequence is not bound. */ + else if (map[ic].type != ISKMAP && keyseq[i+1]) + return ((rl_command_func_t *)NULL); + else /* map[ic].type != ISKMAP && keyseq[i+1] == 0 */ { if (type) *type = map[ic].type; @@ -800,6 +817,7 @@ rl_re_read_init_file (count, ignore) 1. the filename used for the previous call 2. the value of the shell variable `INPUTRC' 3. ~/.inputrc + 4. /etc/inputrc If the file existed and could be opened and read, 0 is returned, otherwise errno is returned. */ int @@ -808,17 +826,18 @@ rl_read_init_file (filename) { /* Default the filename. */ if (filename == 0) + filename = last_readline_init_file; + if (filename == 0) + filename = sh_get_env_value ("INPUTRC"); + if (filename == 0 || *filename == 0) { - filename = last_readline_init_file; - if (filename == 0) - filename = sh_get_env_value ("INPUTRC"); - if (filename == 0) - filename = DEFAULT_INPUTRC; + filename = DEFAULT_INPUTRC; + /* Try to read DEFAULT_INPUTRC; fall back to SYS_INPUTRC on failure */ + if (_rl_read_init_file (filename, 0) == 0) + return 0; + filename = SYS_INPUTRC; } - if (*filename == 0) - filename = DEFAULT_INPUTRC; - #if defined (__MSDOS__) if (_rl_read_init_file (filename, 0) == 0) return 0; @@ -1957,6 +1976,10 @@ rl_invoking_keyseqs_in_map (function, map) if (key == ESC) { + /* If ESC is the meta prefix and we're converting chars + with the eighth bit set to ESC-prefixed sequences, then + we can use \M-. Otherwise we need to use the sequence + for ESC. */ if (_rl_convert_meta_chars_to_ascii && map[ESC].type == ISKMAP) sprintf (keyname, "\\M-"); else diff --git a/lib/readline/display.c~ b/lib/readline/display.c~ index 3f902db67..b349a0f52 100644 --- a/lib/readline/display.c~ +++ b/lib/readline/display.c~ @@ -88,7 +88,7 @@ static int inv_lbsize, vis_lbsize; current cursor position is in the middle of a prompt string containing invisible characters. */ #define PROMPT_ENDING_INDEX \ - ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) ? prompt_physical_chars : prompt_last_invisible) + ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) ? prompt_physical_chars : prompt_last_invisible+1) /* **************************************************************** */ @@ -977,7 +977,11 @@ rl_redisplay () invisible character in the prompt string. */ nleft = prompt_visible_length + wrap_offset; if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 && +#if 0 _rl_last_c_pos <= PROMPT_ENDING_INDEX && local_prompt) +#else + _rl_last_c_pos < PROMPT_ENDING_INDEX && local_prompt) +#endif { #if defined (__MSDOS__) putc ('\r', rl_outstream); @@ -1386,6 +1390,15 @@ update_line (old, new, current_line, omax, nmax, inv_botlin) } } +if (*old == 0 && *new != 0) + { + fprintf (stderr, "old == 0x%x new = 0x%x\r\n", old, new); + fprintf (stderr, "omax == %d nmax = %d\r\n", omax, nmax); + fprintf (stderr, "ne == 0x%x nfd = 0x%x\r\n", ne, nfd); + fprintf (stderr, "oe == 0x%x ofd = 0x%x\r\n", oe, ofd); + fprintf (stderr, "ols == 0x%x nls = 0x%x\r\n", ols, nls); + } + /* count of invisible characters in the current invisible line. */ current_invis_chars = W_OFFSET (current_line, wrap_offset); if (_rl_last_v_pos != current_line) diff --git a/lib/readline/doc/history.dvi b/lib/readline/doc/history.dvi index 55b439319..dac5f5b1d 100644 Binary files a/lib/readline/doc/history.dvi and b/lib/readline/doc/history.dvi differ diff --git a/lib/readline/doc/history.html b/lib/readline/doc/history.html index dc543d8e9..2b50e95c9 100644 --- a/lib/readline/doc/history.html +++ b/lib/readline/doc/history.html @@ -1,6 +1,6 @@ - + + +