wrong option parsing for "make" fixed
This commit is contained in:
parent
5482e5a4db
commit
1c56dffeb5
1 changed files with 11 additions and 12 deletions
|
@ -91,10 +91,16 @@ sub make {
|
||||||
my $commandline = '';
|
my $commandline = '';
|
||||||
$commandline = '-' . $list{'-switches'} if(defined($list{'-switches'}));
|
$commandline = '-' . $list{'-switches'} if(defined($list{'-switches'}));
|
||||||
my @commandline;
|
my @commandline;
|
||||||
# UGLY!
|
foreach ("ewords('\s+', 1, $commandline)) {
|
||||||
foreach (split(/["'](.+?)["']|(\s-\w+)/, $commandline)) {
|
next if (!defined($_));
|
||||||
next if (!defined($_) or !$_ or $_ eq ' ');
|
# untaint input
|
||||||
push @commandline, $_;
|
$_ =~ s/['"]//g;
|
||||||
|
$_ =~ m/^([\w _\/,\.\@:'"-]*)$/;
|
||||||
|
if ($_ =~ /^\s*$/) {
|
||||||
|
push @commandline, "";
|
||||||
|
} else {
|
||||||
|
push @commandline, $1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# These three variables are essential
|
# These three variables are essential
|
||||||
|
@ -148,19 +154,12 @@ sub update {
|
||||||
$switches = '-e' . $switches;
|
$switches = '-e' . $switches;
|
||||||
my @switch_list;
|
my @switch_list;
|
||||||
|
|
||||||
# UGLY!
|
|
||||||
#foreach (split(/["'](.+?)["']|(-\w+)/, $switches)) {
|
|
||||||
# next if (!defined($_));
|
|
||||||
# # untaint input
|
|
||||||
# $_ =~ m/^([\w _\/,\.\@:'"-]*)$/;
|
|
||||||
# push @switches, $1;
|
|
||||||
#}
|
|
||||||
foreach ("ewords('\s+', 1, $switches)) {
|
foreach ("ewords('\s+', 1, $switches)) {
|
||||||
next if (!defined($_));
|
next if (!defined($_));
|
||||||
# untaint input
|
# untaint input
|
||||||
$_ =~ s/['"]//g;
|
$_ =~ s/['"]//g;
|
||||||
$_ =~ m/^([\w _\/,\.\@:'"-]*)$/;
|
$_ =~ m/^([\w _\/,\.\@:'"-]*)$/;
|
||||||
if ($_ eq '') {
|
if ($_ =~ /^\s*$/) {
|
||||||
push @switch_list, "";
|
push @switch_list, "";
|
||||||
} else {
|
} else {
|
||||||
push @switch_list, $1;
|
push @switch_list, $1;
|
||||||
|
|
Loading…
Reference in a new issue