mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-05 11:20:50 +02:00
commit bash-20110720 snapshot
This commit is contained in:
+16
-6
@@ -3652,7 +3652,7 @@ static void
|
||||
fix_assignment_words (words)
|
||||
WORD_LIST *words;
|
||||
{
|
||||
WORD_LIST *w;
|
||||
WORD_LIST *w, *wcmd;
|
||||
struct builtin *b;
|
||||
int assoc;
|
||||
|
||||
@@ -3662,16 +3662,24 @@ fix_assignment_words (words)
|
||||
b = 0;
|
||||
assoc = 0;
|
||||
|
||||
wcmd = words;
|
||||
for (w = words; w; w = w->next)
|
||||
if (w->word->flags & W_ASSIGNMENT)
|
||||
{
|
||||
if (b == 0)
|
||||
{
|
||||
b = builtin_address_internal (words->word->word, 0);
|
||||
/* Posix (post-2008) says that `command' doesn't change whether
|
||||
or not the builtin it shadows is a `declaration command', even
|
||||
though it removes other special builtin properties. In Posix
|
||||
mode, we skip over one or more instances of `command' and
|
||||
deal with the next word as the assignment builtin. */
|
||||
while (posixly_correct && wcmd && wcmd->word && wcmd->word->word && STREQ (wcmd->word->word, "command"))
|
||||
wcmd = wcmd->next;
|
||||
b = builtin_address_internal (wcmd->word->word, 0);
|
||||
if (b == 0 || (b->flags & ASSIGNMENT_BUILTIN) == 0)
|
||||
return;
|
||||
else if (b && (b->flags & ASSIGNMENT_BUILTIN))
|
||||
words->word->flags |= W_ASSNBLTIN;
|
||||
wcmd->word->flags |= W_ASSNBLTIN;
|
||||
}
|
||||
w->word->flags |= (W_NOSPLIT|W_NOGLOB|W_TILDEEXP|W_ASSIGNARG);
|
||||
#if defined (ARRAY_VARS)
|
||||
@@ -3686,13 +3694,15 @@ fix_assignment_words (words)
|
||||
{
|
||||
if (b == 0)
|
||||
{
|
||||
b = builtin_address_internal (words->word->word, 0);
|
||||
while (posixly_correct && wcmd && wcmd->word && wcmd->word->word && STREQ (wcmd->word->word, "command"))
|
||||
wcmd = wcmd->next;
|
||||
b = builtin_address_internal (wcmd->word->word, 0);
|
||||
if (b == 0 || (b->flags & ASSIGNMENT_BUILTIN) == 0)
|
||||
return;
|
||||
else if (b && (b->flags & ASSIGNMENT_BUILTIN))
|
||||
words->word->flags |= W_ASSNBLTIN;
|
||||
wcmd->word->flags |= W_ASSNBLTIN;
|
||||
}
|
||||
if (words->word->flags & W_ASSNBLTIN)
|
||||
if (wcmd->word->flags & W_ASSNBLTIN)
|
||||
assoc = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user