[win32] fixup hv_free_ent() to not fail on null HeVAL()
[p5sagit/p5-mst-13.2.git] / win32 / config_sh.PL
index 0769ef3..0c3713c 100644 (file)
@@ -17,7 +17,15 @@ $opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0]
 while (<>)
  {
   s/~([\w_]+)~/$opt{$1}/g;
-  $_ = "$1='$opt{$1}'\n" if (/^([\w_]+)=/ && exists($opt{$1}));
+  if (/^([\w_]+)=(.*)$/) {
+    # this depends on cf_time being empty in the template (or we'll get a loop)
+    if ($1 eq 'cf_time') {
+      $_ = "$1='" . localtime(time) . "'\n" if $2 =~ /^\s*'\s*'/;
+    }
+    elsif (exists $opt{$1}) {
+      $_ = "$1='$opt{$1}'\n";
+    }
+  }
   print;
  }