commit bash-20120322 snapshot

This commit is contained in:
Chet Ramey
2012-04-09 10:01:06 -04:00
parent 8a44b411b7
commit ec860d767b
18 changed files with 16908 additions and 1764 deletions
+11 -5
View File
@@ -3704,13 +3704,13 @@ fix_assignment_words (words)
{
WORD_LIST *w, *wcmd;
struct builtin *b;
int assoc;
int assoc, global;
if (words == 0)
return;
b = 0;
assoc = 0;
assoc = global = 0;
wcmd = words;
for (w = words; w; w = w->next)
@@ -3735,12 +3735,17 @@ fix_assignment_words (words)
#if defined (ARRAY_VARS)
if (assoc)
w->word->flags |= W_ASSIGNASSOC;
if (global)
w->word->flags |= W_ASSNGLOBAL;
#endif
}
#if defined (ARRAY_VARS)
/* Note that we saw an associative array option to a builtin that takes
assignment statements. This is a bit of a kludge. */
else if (w->word->word[0] == '-' && strchr (w->word->word, 'A'))
else if (w->word->word[0] == '-' && (strchr (w->word->word+1, 'A') || strchr (w->word->word+1, 'g')))
#else
else if (w->word->word[0] == '-' && strchr (w->word->word+1, 'g'))
#endif
{
if (b == 0)
{
@@ -3752,10 +3757,11 @@ fix_assignment_words (words)
else if (b && (b->flags & ASSIGNMENT_BUILTIN))
wcmd->word->flags |= W_ASSNBLTIN;
}
if (wcmd->word->flags & W_ASSNBLTIN)
if ((wcmd->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'A'))
assoc = 1;
if ((wcmd->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'g'))
global = 1;
}
#endif
}
/* Return 1 if the file found by searching $PATH for PATHNAME, defaulting