lib/optiontable.pl: adapt to CURLOPTDEPRECATED()
Follow-up from 6967571bf2
Reported-by: Gisle Vanem
Fixes #9992
Closes #9993
This commit is contained in:
Родитель
f83610c89d
Коммит
ea557cfa27
|
@ -37,10 +37,11 @@ HEAD
|
|||
|
||||
my $lastnum=0;
|
||||
|
||||
while(<STDIN>) {
|
||||
if(/^ *CURLOPT\(([^,]*), ([^,]*), (\d+)\)/) {
|
||||
my($opt, $type, $num)=($1,$2,$3);
|
||||
sub add {
|
||||
my($opt, $type, $num)=@_;
|
||||
my $name;
|
||||
# remove all spaces from the type
|
||||
$type =~ s/ //g;
|
||||
my $ext = $type;
|
||||
|
||||
if($opt =~ /OBSOLETE/) {
|
||||
|
@ -60,12 +61,43 @@ while(<STDIN>) {
|
|||
$type{$name} = $type;
|
||||
push @names, $name;
|
||||
if($num < $lastnum) {
|
||||
print STDERR "ERROR: $opt has bad number\n";
|
||||
print STDERR "ERROR: $opt has bad number: $num < $lastnum\n";
|
||||
exit 2;
|
||||
}
|
||||
else {
|
||||
$lastnum = $num;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $fl;
|
||||
while(<STDIN>) {
|
||||
my $l = $_;
|
||||
if($fl) {
|
||||
# continued deprecation
|
||||
if($l =~ /(.*)\),/) {
|
||||
$fl .= $1;
|
||||
|
||||
# the end
|
||||
my @p=split(/, */, $fl);
|
||||
add($p[0], $p[1], $p[2]);
|
||||
undef $fl;
|
||||
}
|
||||
else {
|
||||
# another line to append
|
||||
chomp $l;
|
||||
$fl .= $l;
|
||||
}
|
||||
}
|
||||
|
||||
if(/^ *CURLOPTDEPRECATED\((.*)/) {
|
||||
$fl = $1;
|
||||
chomp $fl;
|
||||
}
|
||||
|
||||
if(/^ *CURLOPT\(([^,]*), ([^,]*), (\d+)\)/) {
|
||||
my($opt, $type, $num)=($1,$2,$3);
|
||||
add($opt, $type, $num);
|
||||
}
|
||||
|
||||
# alias for an older option
|
||||
|
|
Загрузка…
Ссылка в новой задаче