mirror of
https://github.com/curl/curl.git
synced 2026-08-25 08:23:31 +03:00
scripts: fix perl indentation, whitespace, semicolons
Ref: #17116 Closes #17209
This commit is contained in:
parent
fd4c342d88
commit
3fcddc835c
14 changed files with 1418 additions and 1422 deletions
|
|
@ -293,56 +293,56 @@ sub striparray {
|
|||
# pass array *REFERENCES* !
|
||||
#
|
||||
sub compareparts {
|
||||
my ($firstref, $secondref)=@_;
|
||||
my ($firstref, $secondref)=@_;
|
||||
|
||||
# we cannot compare arrays index per index since with data chunks,
|
||||
# they may not be "evenly" distributed
|
||||
my $first = join("", @$firstref);
|
||||
my $second = join("", @$secondref);
|
||||
# we cannot compare arrays index per index since with data chunks,
|
||||
# they may not be "evenly" distributed
|
||||
my $first = join("", @$firstref);
|
||||
my $second = join("", @$secondref);
|
||||
|
||||
if($first =~ /%alternatives\[/) {
|
||||
die "bad use of compareparts\n";
|
||||
}
|
||||
if($first =~ /%alternatives\[/) {
|
||||
die "bad use of compareparts\n";
|
||||
}
|
||||
|
||||
if($second =~ /%alternatives\[([^,]*),([^\]]*)\]/) {
|
||||
# there can be many %alternatives in this chunk, so we call
|
||||
# this function recursively
|
||||
my $alt = $second;
|
||||
$alt =~ s/%alternatives\[([^,]*),([^\]]*)\]/$1/;
|
||||
if($second =~ /%alternatives\[([^,]*),([^\]]*)\]/) {
|
||||
# there can be many %alternatives in this chunk, so we call
|
||||
# this function recursively
|
||||
my $alt = $second;
|
||||
$alt =~ s/%alternatives\[([^,]*),([^\]]*)\]/$1/;
|
||||
|
||||
# check first alternative
|
||||
{
|
||||
my @f;
|
||||
my @s;
|
||||
push @f, $first;
|
||||
push @s, $alt;
|
||||
if(!compareparts(\@f, \@s)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
# check first alternative
|
||||
{
|
||||
my @f;
|
||||
my @s;
|
||||
push @f, $first;
|
||||
push @s, $alt;
|
||||
if(!compareparts(\@f, \@s)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
$alt = $second;
|
||||
$alt =~ s/%alternatives\[([^,]*),([^\]]*)\]/$2/;
|
||||
# check second alternative
|
||||
{
|
||||
my @f;
|
||||
my @s;
|
||||
push @f, $first;
|
||||
push @s, $alt;
|
||||
if(!compareparts(\@f, \@s)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
$alt = $second;
|
||||
$alt =~ s/%alternatives\[([^,]*),([^\]]*)\]/$2/;
|
||||
# check second alternative
|
||||
{
|
||||
my @f;
|
||||
my @s;
|
||||
push @f, $first;
|
||||
push @s, $alt;
|
||||
if(!compareparts(\@f, \@s)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
# neither matched
|
||||
return 1;
|
||||
}
|
||||
# neither matched
|
||||
return 1;
|
||||
}
|
||||
|
||||
if($first ne $second) {
|
||||
return 1;
|
||||
}
|
||||
if($first ne $second) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue