mirror of
https://github.com/curl/curl.git
synced 2026-07-30 19:48:04 +03:00
managen: apply minor fixes and improvements
- replace `goto` with `while` loop. - fix newlines in a warning message. - handle open error for `curl/curlver.h` header. Ref: #21646 Closes #21670
This commit is contained in:
parent
81da4ee249
commit
6999ccb8e0
1 changed files with 21 additions and 21 deletions
|
|
@ -705,7 +705,7 @@ sub single {
|
|||
}
|
||||
else {
|
||||
chomp;
|
||||
print STDERR "$f:$line:1:WARN: unrecognized line in $f, ignoring:\n:'$_';"
|
||||
print STDERR "$f:$line:1:WARN: unrecognized line in $f, ignoring: '$_';\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1337,25 +1337,25 @@ my $dir = ".";
|
|||
my $include = "../../include";
|
||||
my $cmd = shift @ARGV || '';
|
||||
|
||||
check:
|
||||
|
||||
if($cmd eq "-d") {
|
||||
# specifies source directory
|
||||
$dir = shift @ARGV;
|
||||
$cmd = shift @ARGV;
|
||||
goto check;
|
||||
}
|
||||
elsif($cmd eq "-I") {
|
||||
# include path root
|
||||
$include = shift @ARGV;
|
||||
$cmd = shift @ARGV;
|
||||
goto check;
|
||||
}
|
||||
elsif($cmd eq "-c") {
|
||||
# Column width
|
||||
$colwidth = 0 + shift @ARGV;
|
||||
$cmd = shift @ARGV;
|
||||
goto check;
|
||||
while(1) {
|
||||
if($cmd eq "-d") {
|
||||
# specifies source directory
|
||||
$dir = shift @ARGV;
|
||||
$cmd = shift @ARGV;
|
||||
}
|
||||
elsif($cmd eq "-I") {
|
||||
# include path root
|
||||
$include = shift @ARGV;
|
||||
$cmd = shift @ARGV;
|
||||
}
|
||||
elsif($cmd eq "-c") {
|
||||
# Column width
|
||||
$colwidth = 0 + shift @ARGV;
|
||||
$cmd = shift @ARGV;
|
||||
}
|
||||
else {
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
my @files = @ARGV; # the rest are the files
|
||||
|
|
@ -1365,7 +1365,7 @@ if($ENV{'CURL_MAKETGZ_VERSION'}) {
|
|||
$version = $ENV{'CURL_MAKETGZ_VERSION'};
|
||||
}
|
||||
else {
|
||||
open(INC, "<$include/curl/curlver.h");
|
||||
open(INC, "<$include/curl/curlver.h") || die "no $include/curl/curlver.h";
|
||||
while(<INC>) {
|
||||
if($_ =~ /^#define LIBCURL_VERSION \"([0-9.]*)/) {
|
||||
$version = $1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue