At 01:32 PM 09/06/2001, Stas Bekman wrote:
>Also the regex that does s/(foo)/{foo}/ is cleaner in case someone was
>doing $(foo)_bar with the current patch, this will break, since it
>makes
>$foo_bar, whereas it should be better ${foo}_bar.
A regexp is overkill in this case, assuming that the input is a known
set, and all parens need to be changed to braces.
--- apxs.in.orig Fri Sep 7 01:27:52 2001
+++ apxs.in Fri Sep 7 01:27:56 2001
@@ -245,6 +245,8 @@
open IN, $file or die "cannot open $file: $!";
while (<IN>){
+ # $(foo) => ${foo}
+ tr/()/{}/;
if (/^\s*(.*?)\s*=\s*(.*)$/){
$rh_config->{$1} = $2;
}
@@ -261,7 +263,6 @@
my $val = exists $config_vars{$arg}
? $config_vars{$arg}
: $config_vars{lc $arg};
- $val =~ s/[()]//g;
$result .= eval qq("$val");
$result .= ";;";
$ok = 1;
@@ -270,7 +271,7 @@
if (exists $internal_vars{$arg} or exists
$internal_vars{lc $arg}) {
my $val = exists $internal_vars{$arg} ? $arg : lc
$arg;
$val = eval "\$CFG_$val";
- $result .= eval qq("$val");
+ $result .= eval qq("$val") if defined $val;
$result .= ";;";
$ok = 1;
}
--
Greg Marr
[EMAIL PROTECTED]
"We thought you were dead."
"I was, but I'm better now." - Sheridan, "The Summoning"