aboutsummaryrefslogtreecommitdiffstats
path: root/execute_cmd.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2012-05-07 16:22:49 -0400
committerChet Ramey <chet.ramey@case.edu>2012-05-07 16:22:49 -0400
commit6d41b71587a48f90a555846477b2ff6a976d766d (patch)
tree54cb661d48bc28bec5ec07dca99501519115fd29 /execute_cmd.c
parent6c19148d3350504ff170ca6fabc9b120ad3f3378 (diff)
downloadandroid_external_bash-6d41b71587a48f90a555846477b2ff6a976d766d.tar.gz
android_external_bash-6d41b71587a48f90a555846477b2ff6a976d766d.tar.bz2
android_external_bash-6d41b71587a48f90a555846477b2ff6a976d766d.zip
Bash-4.2 patch 25
Diffstat (limited to 'execute_cmd.c')
-rw-r--r--execute_cmd.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/execute_cmd.c b/execute_cmd.c
index 30b0460..3f9c150 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -3580,13 +3580,13 @@ fix_assignment_words (words)
{
WORD_LIST *w;
struct builtin *b;
- int assoc;
+ int assoc, global;
if (words == 0)
return;
b = 0;
- assoc = 0;
+ assoc = global = 0;
for (w = words; w; w = w->next)
if (w->word->flags & W_ASSIGNMENT)
@@ -3603,12 +3603,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)
{
@@ -3618,10 +3623,11 @@ fix_assignment_words (words)
else if (b && (b->flags & ASSIGNMENT_BUILTIN))
words->word->flags |= W_ASSNBLTIN;
}
- if (words->word->flags & W_ASSNBLTIN)
+ if ((words->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'A'))
assoc = 1;
+ if ((words->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