installer: make rewrite-config.PL change only defined parameters
authorGalen Charlton <galen.charlton@liblime.com>
Thu, 13 Dec 2007 20:08:16 +0000 (14:08 -0600)
committerGalen Charlton <galen.charlton@liblime.com>
Mon, 17 Dec 2007 15:13:53 +0000 (09:13 -0600)
Previously, it tried to slurp up all text between two
occurences of '__'

rewrite-config.PL

index 5a372a0..9f4297a 100644 (file)
@@ -115,7 +115,7 @@ foreach $key (keys %configuration) {
 
 $fname = $ARGV[0];
 $file = read_file($fname);
-$file =~ s/__.*?__/$configuration{$&}/seg;
+$file =~ s/__.*?__/exists $configuration{$&} ? $configuration{$&} : $&/seg;
 chmod 0644, $fname;
 open(OUTPUT,">$fname") || die "Can't open $fname for write: $!";
 print OUTPUT $file;