commit bash-20170407 snapshot

This commit is contained in:
Chet Ramey
2017-04-10 16:25:57 -04:00
parent 7c4ef411b5
commit 1a5fa30baf
43 changed files with 14065 additions and 13436 deletions
+18 -2
View File
@@ -3389,7 +3389,7 @@ execute_case_command (case_command)
WORD_LIST *wlist, *es;
PATTERN_LIST *clauses;
char *word, *pattern;
int retval, match, ignore_return, save_line_number;
int retval, match, ignore_return, save_line_number, qflags;
save_line_number = line_number;
line_number = case_command->line;
@@ -3441,7 +3441,15 @@ execute_case_command (case_command)
es = expand_word_leave_quoted (list->word, 0);
if (es && es->word && es->word->word && *(es->word->word))
pattern = quote_string_for_globbing (es->word->word, QGLOB_CVTNULL);
{
qflags = QGLOB_CVTNULL;
/* We left CTLESC in place quoting CTLESC after the call to
expand_word_leave_quoted; tell quote_string_for_globbing to
remove those here */
if ((list->word->flags & W_QUOTED) == 0)
qflags |= QGLOB_CTLESC;
pattern = quote_string_for_globbing (es->word->word, qflags);
}
else
{
pattern = (char *)xmalloc (1);
@@ -5689,6 +5697,7 @@ execute_intern_function (name, funcdef)
FUNCTION_DEF *funcdef;
{
SHELL_VAR *var;
char *t;
if (check_identifier (name, posixly_correct) == 0)
{
@@ -5700,6 +5709,13 @@ execute_intern_function (name, funcdef)
return (EXECUTION_FAILURE);
}
if (strchr (name->word, CTLESC)) /* WHY? */
{
t = dequote_escapes (name->word);
free (name->word);
name->word = t;
}
/* Posix interpretation 383 */
if (posixly_correct && find_special_builtin (name->word))
{