Fixed expansion of [<char0>-<char1>] filename pattern ranges.
[macros.git] / AutoGen.pm
index 1fad581..45f6d7e 100644 (file)
@@ -159,7 +159,7 @@ my($class,%args)=@_;
        $spec=~s/\\\n/ /gs;
        $class->run(%Options,
                        "ARGV"=>["--copy"],
-                       "configure_args"=>[split /\s+/,($spec=~/^%configure\s+(.*)$/m)[0]],
+                       "configure_args"=>[split /\s+/,($spec=~/^[%]configure\b[ \t]*(.*)$/m)[0]],
                        );
        _remove "ChangeLog";    # force its rebuild by Makefile/rcs2log
        _system "make dist $name.spec";
@@ -333,8 +333,10 @@ sub _expandclass
 my($patt)=@_;
 
        return $patt if $patt!~/\Q[\E(.*?)\Q]\E/;
-       my($pre,$post)=($`,$'); # FIXME: local($`,$') doesn't work - why?
-       return map({ _expandclass("$pre$_$post"); } split("",$1));
+       my($pre,$range,$post)=($`,$1,$');       # FIXME: local($`,$1,$') doesn't work - why?
+       1 while $range=~s#(.)-(.)# join("",map(chr,(ord($1)..ord($2))));
+                       #ge;
+       return map({ _expandclass("$pre$_$post"); } split("",$range));
 }
 
 sub run