Fix empty variable handling when /bin/sh is bash

This commit is contained in:
Tom Eastep 2011-01-20 07:27:14 -08:00
parent 878e5d66ae
commit 24412c9498

View File

@ -2871,7 +2871,7 @@ sub get_params() {
if ( /^declare -x (.*?)="(.*[^\\])"$/ ) {
$params{$1} = $2 unless $1 eq '_';
} elsif ( /^declare -x (.*?)="(.*)$/ ) {
$params{$variable=$1}="${2}\n";
$params{$variable=$1} = $2 eq '"' ? '' : "${2}\n";
} elsif ( /^declare -x (.*)\s+$/ || /^declare -x (.*)=""$/ ) {
$params{$1} = '';
} else {
@ -2895,7 +2895,7 @@ sub get_params() {
if ( /^export (.*?)="(.*[^\\])"$/ ) {
$params{$1} = $2 unless $1 eq '_';
} elsif ( /^export (.*?)="(.*)$/ ) {
$params{$variable=$1}="${2}\n";
$params{$variable=$1} = $2 eq '"' ? '' : "${2}\n";
} elsif ( /^export (.*)\s+$/ || /^export (.*)=""$/ ) {
$params{$1} = '';
} else {