Changeset 29582

Show
Ignore:
Timestamp:
11.12.2014 15:42:41 (5 years ago)
Author:
ak19
Message:

util::setup_greenstone_env() needs to handle env vars whose values are multi-line.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/util.pm

    r29112 r29582  
    13481348    } 
    13491349 
     1350    my $lastkey; 
    13501351    while (defined (my $perl_output_line = <PIN>)) { 
    13511352        my($key,$value) = ($perl_output_line =~ m/^([^=]*)[=](.*)$/); 
    1352         #$env_map{$key}=$value;      
    1353         $ENV{$key}=$value; 
     1353        if(defined $key) { 
     1354            #$env_map{$key}=$value;      
     1355            $ENV{$key}=$value; 
     1356            $lastkey = $key; 
     1357        } elsif($lastkey && $perl_output_line !~ m/^\s*$/) {  
     1358            # there was no equals sign in $perl_output_line, so this  
     1359            # $perl_output_line may be a spillover from the previous 
     1360            $ENV{$lastkey} = $ENV{$lastkey}."\n".$perl_output_line; 
     1361        } 
    13541362    } 
    13551363    close (PIN);