configpm: handle multi-line key='value\n...'
authorDavid Mitchell <davem@iabyn.com>
Mon, 18 Apr 2011 18:29:52 +0000 (19:29 +0100)
committerDavid Mitchell <davem@iabyn.com>
Mon, 18 Apr 2011 18:29:52 +0000 (19:29 +0100)
There is old code in configpm to handle mulit-line entries in config.sh
along the lines of

    plibpth='/lib/x86_64-redhat-linux/4.4.5/
    /lib/../lib64/
    /usr/lib/x86_64-redhat-linux/4.4.5/
    /usr/lib/../lib64/
    /lib/
    /usr/lib/'

which was broken, and produced
    Use of uninitialized value $1
warnings, and messed up the content of lib/Config_heavy.pl.

We probably normally don't have multi-line entries, which is why no-one
noticed it before, but 40f026236b9959b7ad3260fedc6c66cd30bb7abc
has started generating the entry above.

configpm

index 7d6de37..77e0a56 100755 (executable)
--- a/configpm
+++ b/configpm
@@ -292,6 +292,7 @@ my @non_v    = ();
 my @v_others = ();
 my $in_v     = 0;
 my %Data     = ();
+my $quote;
 
 
 my %seen_quotes;
@@ -323,11 +324,11 @@ my %seen_quotes;
        push(@non_v, "#$_"); # not a name='value' line
        next;
     }
-    my $quote = $2;
     if ($in_v) { 
         $val .= $_;
     }
     else { 
+       $quote = $2;
         ($name,$val) = ($1,$3); 
     }
     $in_v = $val !~ /$quote\n/;