httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Marr <gr...@alum.wpi.edu>
Subject Re: apxs broken
Date Thu, 06 Sep 2001 17:59:03 GMT
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
gregm@alum.wpi.edu
"We thought you were dead."
"I was, but I'm better now." - Sheridan, "The Summoning"


Mime
View raw message