From: Chet Ramey Date: Wed, 7 Dec 2011 14:14:23 +0000 (-0500) Subject: commit bash-20071018 snapshot X-Git-Tag: bash-4.0-alpha~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc12da027f614f19a79935666d0988861a80ab1f;p=thirdparty%2Fbash.git commit bash-20071018 snapshot --- diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index d96e95832..b1b40cad8 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -14963,3 +14963,18 @@ pcomplete.c instead of the shell metacharacters to split words, so programmable completion does the same thing readline does internally. Reported by Vasily Tarasov + + 10/16 + ----- +bashline.c + - When completing a command name beginnig with a tilde and containing + escaped specical characters, dequote the filename before prefixing + it to the matches, so the escapes are not quoted again. Reported + by neil@s-z.org + + 10/17 + ----- +expr.c + - in readtok(), don't reset lasttp if we've consumed the whitespace + at the end of the expression string. Fixes error message problem + reported by diff --git a/bashline.c b/bashline.c index 809fe32b6..4626bad2d 100644 --- a/bashline.c +++ b/bashline.c @@ -1477,9 +1477,12 @@ command_word_completion_function (hint_text, state) if (*hint_text == '~') { int l, tl, vl, dl; - char *rd; + char *rd, *dh; + + dh = bash_dequote_filename ((char *)hint_text, 0); + vl = strlen (val); - tl = strlen (hint_text); + tl = strlen (dh); #if 0 l = vl - hint_len; /* # of chars added */ #else @@ -1490,8 +1493,9 @@ command_word_completion_function (hint_text, state) free (rd); #endif temp = (char *)xmalloc (l + 2 + tl); - strcpy (temp, hint_text); + strcpy (temp, dh); strcpy (temp + tl, val + vl - l); + free (dh); } else temp = savestring (val); diff --git a/builtins/reserved.def b/builtins/reserved.def index 3a14ad2e5..a7200dce0 100644 --- a/builtins/reserved.def +++ b/builtins/reserved.def @@ -2,7 +2,7 @@ This file is reserved.def, in which the shell reserved words are defined. It has no direct C file production, but defines builtins for the Bash builtin help command. -Copyright (C) 1987-2006 Free Software Foundation, Inc. +Copyright (C) 1987-2007 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. @@ -21,7 +21,7 @@ with Bash; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. $BUILTIN for -$SHORT_DOC for NAME [in WORDS ... ;] do COMMANDS; done +$SHORT_DOC for NAME [in WORDS ... ] ; do COMMANDS; done The `for' loop executes a sequence of commands for each member in a list of items. If `in WORDS ...;' is not present, then `in "$@"' is assumed. For each element in WORDS, NAME is set to that element, and diff --git a/expr.c b/expr.c index a4e500ff1..b325a82f8 100644 --- a/expr.c +++ b/expr.c @@ -1032,8 +1032,6 @@ readtok () if (c) cp++; - lasttp = tp = cp - 1; - if (c == '\0') { lasttok = curtok; @@ -1041,6 +1039,7 @@ readtok () tp = cp; return; } + lasttp = tp = cp - 1; if (legal_variable_starter (c)) {