X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=subst.c;h=c9a06788f905c074710b7538a6c78a49abaa5360;hb=6d41b71587a48f90a555846477b2ff6a976d766d;hp=83b23dddf209cabe1374e34f8624fd75d983e638;hpb=aeb26a67db0df058436b835363fc433e258719f3;p=platform%2Fupstream%2Fbash.git diff --git a/subst.c b/subst.c index 83b23dd..c9a0678 100644 --- a/subst.c +++ b/subst.c @@ -366,6 +366,11 @@ dump_word_flags (flags) f &= ~W_ASSNBLTIN; fprintf (stderr, "W_ASSNBLTIN%s", f ? "|" : ""); } + if (f & W_ASSNGLOBAL) + { + f &= ~W_ASSNGLOBAL; + fprintf (stderr, "W_ASSNGLOBAL%s", f ? "|" : ""); + } if (f & W_COMPASSIGN) { f &= ~W_COMPASSIGN; @@ -2803,7 +2808,7 @@ do_assignment_internal (word, expand) } else if (assign_list) { - if (word->flags & W_ASSIGNARG) + if ((word->flags & W_ASSIGNARG) && (word->flags & W_ASSNGLOBAL) == 0) aflags |= ASS_MKLOCAL; if (word->flags & W_ASSIGNASSOC) aflags |= ASS_MKASSOC; @@ -3706,7 +3711,10 @@ remove_quoted_nulls (string) break; } else if (string[i] == CTLNUL) - i++; + { + i++; + continue; + } prev_i = i; ADVANCE_CHAR (string, slen, i); @@ -4609,6 +4617,7 @@ expand_word_unsplit (word, quoted) if (ifs_firstc == 0) #endif word->flags |= W_NOSPLIT; + word->flags |= W_NOSPLIT2; result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); expand_no_split_dollar_star = 0; @@ -7270,6 +7279,7 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta default: case '\0': bad_substitution: + last_command_exit_value = EXECUTION_FAILURE; report_error (_("%s: bad substitution"), string ? string : "??"); FREE (value); FREE (temp);