Tom Tromey <[EMAIL PROTECTED]> writes:

> Akim> -    local ($in_ac_output, $in_ac_replace) = (0, 0);
> Akim> +    # Watchout: these guys need dynamic scope!
> 
> Why remove the other local() though?
> Those variables also have dynamic scope :-(

Hm, do they?

I moved them inside the routines which uses them:

~/src/am % cat /tmp/in-ac.sed                                    nostromo 19:33
#n
/^sub/, /^}/ {
  /^sub/h
  /in_ac/{x; p; x; p;}
}
~/src/am % sed -f /tmp/in-ac.sed automake.in                     nostromo 19:33
sub scan_one_autoconf_file
        if (! $in_ac_replace && s/AC_REPLACE_FUNCS\s*\(\[?//)
sub scan_one_autoconf_file
            $in_ac_replace = 1;
sub scan_one_autoconf_file
        if ($in_ac_replace)
sub scan_one_autoconf_file
            $in_ac_replace = 0 if s/[\]\)].*$//;
sub scan_one_autoconf_file
        if (! $in_ac_output && s/AC_(OUTPUT|CONFIG_FILES)\s*\(\[?//)
sub scan_one_autoconf_file
            $in_ac_output = 1;
sub scan_one_autoconf_file
        if ($in_ac_output)
sub scan_one_autoconf_file
                $in_ac_output = 0;
sub scan_autoconf_files
    local ($in_ac_output, $in_ac_replace) = (0, 0);

Reply via email to