Mail Archives: djgpp/2001/10/22/15:19:14
JT Williams <jeffw AT darwin DOT sfbr DOT org> wrote:
>Can anyone confirm the following behavior
>with the djgpp port of bash 2.04? TIA/jtw
>
>djdev 2.03; bash 2.04
>---------------------
>foo: after bar: n=3 <- n=3 !?
>
>Solaris
>-------
>foo: after bar: n=1 <- n=1 (as expected)
A comment in builtins/source.def does say:
/* If this . script is supplied arguments, we save the dollar vars and
replace them with the script arguments for the duration of the script's
execution. If the script does not change the dollar vars, we restore
what we saved. If the dollar vars are changed in the script, and we are
not executing a shell function, we leave the new values alone and free
the saved values. */
static void
maybe_pop_dollar_vars ()
{
if (variable_context == 0 && dollar_vars_changed ())
So -- going by the comment quoted above -- the Solaris example does seem to report
the correct value, but I can't find any code in Bash that detects when the "dollar
vars" have changed and behave like the Solaris example.
--
Mark E.: snowball3 AT softhome DOT net
- Raw text -