tidy-up: whitespace (more in Perl)

Follow-up to 8eab2b70860e285525130f69b22ac5567292c659 #17896
Cherry-picked from #17877
Closes #17901
This commit is contained in:
Viktor Szakats 2025-07-11 16:04:24 +02:00
parent 8eab2b7086
commit ddcfd2d511
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
43 changed files with 84 additions and 98 deletions

View File

@ -25,7 +25,7 @@
use POSIX qw(strftime);
my @ts;
if (defined($ENV{SOURCE_DATE_EPOCH})) {
if(defined($ENV{SOURCE_DATE_EPOCH})) {
@ts = localtime($ENV{SOURCE_DATE_EPOCH});
} else {
@ts = localtime;

View File

@ -54,7 +54,7 @@ while(1) {
use POSIX qw(strftime);
my @ts;
if (defined($ENV{SOURCE_DATE_EPOCH})) {
if(defined($ENV{SOURCE_DATE_EPOCH})) {
@ts = localtime($ENV{SOURCE_DATE_EPOCH});
} else {
@ts = localtime;

View File

@ -76,7 +76,7 @@ HELP
use POSIX qw(strftime);
my @ts;
if (defined($ENV{SOURCE_DATE_EPOCH})) {
if(defined($ENV{SOURCE_DATE_EPOCH})) {
@ts = gmtime($ENV{SOURCE_DATE_EPOCH});
} else {
@ts = localtime;

View File

@ -169,17 +169,17 @@ sub readlocalfile {
$i++;
# Lines starting with '#' are considered comments
if (/^\s*(#.*)/) {
if(/^\s*(#.*)/) {
next;
}
elsif (/^enable ([A-Z]+)$/) {
elsif(/^enable ([A-Z]+)$/) {
if(!defined($warnings_extended{$1})) {
print STDERR "invalid warning specified in .checksrc: \"$1\"\n";
next;
}
$warnings{$1} = $warnings_extended{$1};
}
elsif (/^disable ([A-Z]+)$/) {
elsif(/^disable ([A-Z]+)$/) {
if(!defined($warnings{$1})) {
print STDERR "invalid warning specified in .checksrc: \"$1\"\n";
next;
@ -187,10 +187,10 @@ sub readlocalfile {
# Accept-list
push @alist, $1;
}
elsif (/^banfunc ([^ ]*)/) {
elsif(/^banfunc ([^ ]*)/) {
$banfunc{$1} = $1;
}
elsif (/^allowfunc ([^ ]*)/) {
elsif(/^allowfunc ([^ ]*)/) {
undef $banfunc{$1};
}
else {
@ -344,7 +344,7 @@ readlocalfile($file);
do {
if("$wlist" !~ / $file /) {
my $fullname = $file;
$fullname = "$dir/$file" if ($fullname !~ '^\.?\.?/');
$fullname = "$dir/$file" if($fullname !~ '^\.?\.?/');
scanfile($fullname);
}
$file = shift @ARGV;

View File

@ -40,13 +40,13 @@ Pod::Usage::pod2usage() if $help;
my @opts = parse_main_opts($opts_dir);
if ($shell eq 'fish') {
if($shell eq 'fish') {
print "# curl fish completion\n\n";
print "# Complete file paths after @\n";
print q(complete -c curl -n 'string match -qr "^@" -- (commandline -ct)' -k -xa "(printf '%s\n' -- @(__fish_complete_suffix --complete=(commandline -ct | string replace -r '^@' '') ''))");
print "\n\n";
print qq{$_ \n} foreach (@opts);
} elsif ($shell eq 'zsh') {
} elsif($shell eq 'zsh') {
my $opts_str;
$opts_str .= qq{ $_ \\\n} foreach (@opts);
@ -99,10 +99,10 @@ sub parse_main_opts {
$file_content = $1;
my ($short, $long, $arg, $desc);
if ($file_content =~ /^Short:\s+(.*)\s*$/im) {$short = "-$1";}
if ($file_content =~ /^Long:\s+(.*)\s*$/im) {$long = "--$1";}
if ($file_content =~ /^Arg:\s+(.*)\s*$/im) {$arg = $1;}
if ($file_content =~ /^Help:\s+(.*)\s*$/im) {$desc = $1;}
if($file_content =~ /^Short:\s+(.*)\s*$/im) {$short = "-$1";}
if($file_content =~ /^Long:\s+(.*)\s*$/im) {$long = "--$1";}
if($file_content =~ /^Arg:\s+(.*)\s*$/im) {$arg = $1;}
if($file_content =~ /^Help:\s+(.*)\s*$/im) {$desc = $1;}
$arg =~ s/\:/\\\:/g if defined $arg;
$desc =~ s/'/'\\''/g if defined $desc;
@ -112,7 +112,7 @@ sub parse_main_opts {
my $option = '';
if ($shell eq 'fish') {
if($shell eq 'fish') {
$option .= "complete --command curl";
$option .= " --short-option '" . strip_dash(trim($short)) . "'"
if defined $short;
@ -120,23 +120,23 @@ sub parse_main_opts {
if defined $long;
$option .= " --description '" . strip_dash(trim($desc)) . "'"
if defined $desc;
} elsif ($shell eq 'zsh') {
} elsif($shell eq 'zsh') {
$option .= '{' . trim($short) . ',' if defined $short;
$option .= trim($long) if defined $long;
$option .= '}' if defined $short;
$option .= '\'[' . trim($desc) . ']\'' if defined $desc;
if (defined $arg) {
if(defined $arg) {
$option .= ":'$arg'";
if ($arg =~ /<file ?(name)?>|<path>/) {
if($arg =~ /<file ?(name)?>|<path>/) {
$option .= ':_files';
} elsif ($arg =~ /<dir>/) {
} elsif($arg =~ /<dir>/) {
$option .= ":'_path_files -/'";
} elsif ($arg =~ /<url>/i) {
} elsif($arg =~ /<url>/i) {
$option .= ':_urls';
} elsif ($long =~ /ftp/ && $arg =~ /<method>/) {
} elsif($long =~ /ftp/ && $arg =~ /<method>/) {
$option .= ":'(multicwd nocwd singlecwd)'";
} elsif ($arg =~ /<method>/) {
} elsif($arg =~ /<method>/) {
$option .= ":'(DELETE GET HEAD POST PUT)'";
}
}

View File

@ -49,7 +49,7 @@ my %catlong;
use POSIX qw(strftime);
my @ts;
if (defined($ENV{SOURCE_DATE_EPOCH})) {
if(defined($ENV{SOURCE_DATE_EPOCH})) {
@ts = gmtime($ENV{SOURCE_DATE_EPOCH});
} else {
@ts = localtime;
@ -195,7 +195,7 @@ sub printdesc {
chomp $l;
lastline($baselvl + $lvl + 1, $l);
my $w = ($baselvl + $lvl + 1) * $indent + length($l);
if ($w > $colwidth) {
if($w > $colwidth) {
print STDERR "ERROR: $w columns is too long\n";
print STDERR "$l\n";
$error++;
@ -1176,7 +1176,7 @@ sub mainpage {
.\\"
.TH curl 1 "$date" "curl $version" "curl Manual"
HEADER
if ($manpage);
if($manpage);
while(<$fh>) {
my $f = $_;

View File

@ -162,4 +162,4 @@ for my $l (sort keys %flink) {
}
}
exit 1 if ($error);
exit 1 if($error);

View File

@ -268,7 +268,7 @@ sub oldhash {
return $hash;
}
if( $opt_p !~ m/:/ ) {
if($opt_p !~ m/:/) {
print "Error: Mozilla trust identifier list must include both purposes and levels\n";
HELP_MESSAGE();
}
@ -285,7 +285,7 @@ sub should_output_cert(%) {
foreach my $level (@included_mozilla_trust_levels) {
# for each level we want to output, see if any of our desired purposes are
# included
return 1 if( defined( List::Util::first { is_in_list( $_, @included_mozilla_trust_purposes ) } @{$trust_purposes_by_level{$level}} ) );
return 1 if(defined( List::Util::first { is_in_list( $_, @included_mozilla_trust_purposes ) } @{$trust_purposes_by_level{$level}} ));
}
return 0;
@ -656,8 +656,8 @@ unless($stdout) {
$bk++;
}
rename $crt, "$crt.~${bk}~" or die "Failed to create backup $crt.~$bk}~: $!\n";
} elsif( -e $crt ) {
unlink( $crt ) or die "Failed to remove $crt: $!\n";
} elsif(-e $crt) {
unlink($crt) or die "Failed to remove $crt: $!\n";
}
rename "$crt.~", $crt or die "Failed to rename $crt.~ to $crt: $!\n";
}

View File

@ -176,7 +176,7 @@ open(N, "nm $file|") ||
my %exist;
my %uses;
my $file;
while (<N>) {
while(<N>) {
my $l = $_;
chomp $l;

View File

@ -32,7 +32,7 @@ use warnings;
sub checkcmd {
my ($cmd)=@_;
my @paths;
if ($^O eq 'MSWin32' || $^O eq 'dos' || $^O eq 'os2') {
if($^O eq 'MSWin32' || $^O eq 'dos' || $^O eq 'os2') {
# PATH separator is different
@paths=(split(';', $ENV{'PATH'}));
}
@ -41,7 +41,7 @@ sub checkcmd {
"/sbin", "/usr/bin", "/usr/local/bin");
}
for(@paths) {
if( -x "$_/$cmd" && ! -d "$_/$cmd" ) {
if(-x "$_/$cmd" && ! -d "$_/$cmd") {
# executable bit but not a directory!
return "$_/$cmd";
}

View File

@ -44,7 +44,7 @@ const unsigned char ${varname}[] = {
HEAD
;
while (<STDIN>) {
while(<STDIN>) {
my $line = $_;
foreach my $n (split //, $line) {
my $ord = ord($n);

View File

@ -34,7 +34,7 @@ push @out, " / __| | | | |_) | |\n";
push @out, " | (__| |_| | _ <| |___\n";
push @out, " \\___|\\___/|_| \\_\\_____|\n";
while (<STDIN>) {
while(<STDIN>) {
my $line = $_;
push @out, $line;
}
@ -58,7 +58,7 @@ if($c) {
IO::Compress::Gzip->import();
1;
};
print STDERR "Warning: compression requested but Gzip is not available\n" if (!$c)
print STDERR "Warning: compression requested but Gzip is not available\n" if(!$c)
}
if($c)

View File

@ -65,7 +65,7 @@ sub appveyor_create_test_result {
}
' \\
'$appveyor_baseurl/api/tests'`;
print "AppVeyor API result: $appveyor_result\n" if ($appveyor_result);
print "AppVeyor API result: $appveyor_result\n" if($appveyor_result);
$APPVEYOR_TEST_NAMES{$testnum}=$testname;
}
@ -111,7 +111,7 @@ sub appveyor_update_test_result {
}
' \\
'$appveyor_baseurl/api/tests'`;
print "AppVeyor API result: $appveyor_result\n" if ($appveyor_result);
print "AppVeyor API result: $appveyor_result\n" if($appveyor_result);
if($appveyor_category eq 'Error') {
$appveyor_result=`$curl --silent --noproxy '*' \\
--header 'Content-Type: application/json' \\
@ -123,7 +123,7 @@ sub appveyor_update_test_result {
}
' \\
'$appveyor_baseurl/api/build/messages'`;
print "AppVeyor API result: $appveyor_result\n" if ($appveyor_result);
print "AppVeyor API result: $appveyor_result\n" if($appveyor_result);
}
}

View File

@ -62,7 +62,7 @@ HTTP follow redirect from IPv4 to IPv6 with scope
http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L
</command>
<precheck>
%PERL -e "print 'Test is not supported on the Windows kernel' if ($^O eq 'MSWin32' || $^O eq 'msys' || $^O eq 'cygwin');"
%PERL -e "print 'Test is not supported on the Windows kernel' if($^O eq 'MSWin32' || $^O eq 'msys' || $^O eq 'cygwin');"
</precheck>
</client>

View File

@ -35,7 +35,7 @@ HTTP GET with localhost --interface
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -4 --interface 127.0.0.1
</command>
<precheck>
%PERL -e "print 'Test requires default test client host address' if ( '%CLIENTIP' ne '127.0.0.1' );"
%PERL -e "print 'Test requires default test client host address' if('%CLIENTIP' ne '127.0.0.1');"
</precheck>
</client>

View File

@ -39,7 +39,7 @@ HTTP-IPv6 GET with ip6-localhost --interface
-g "http://%HOST6IP:%HTTP6PORT/%TESTNUMBER" --interface ip6-localhost
</command>
<precheck>
%PERL -e "if ('%CLIENT6IP' ne '[::1]') {print 'Test requires default test client host address';} else {exec '%RESOLVE --ipv6 ip6-localhost'; print 'Cannot run precheck resolve';}"
%PERL -e "if('%CLIENT6IP' ne '[::1]') {print 'Test requires default test client host address';} else {exec '%RESOLVE --ipv6 ip6-localhost'; print 'Cannot run precheck resolve';}"
</precheck>
</client>

View File

@ -89,7 +89,7 @@ Accept: */*
* Connection #3 to host server4.example.com left intact
</file>
<stripfile>
$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))
$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/))
</stripfile>
</verify>
</testcase>

View File

@ -89,7 +89,7 @@ Accept: */*
* Connection #3 to host server4.example.com left intact
</file>
<stripfile>
$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))
$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/))
</stripfile>
</verify>
</testcase>

View File

@ -74,7 +74,7 @@ Accept: */*
^Host:.*
</strip>
<stripfile>
$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))
$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/))
</stripfile>
</verify>
</testcase>

View File

@ -62,7 +62,7 @@ Accept: */*
== Info: Connection #1 to host %HOSTIP left intact
</file>
<stripfile>
$_ = '' if (($_ !~ /left intact/) && ($_ !~ /(closing|shutting down) connection #\d+/))
$_ = '' if(($_ !~ /left intact/) && ($_ !~ /(closing|shutting down) connection #\d+/))
</stripfile>
</verify>
</testcase>

View File

@ -27,7 +27,7 @@ file:// with Unix path resolution behavior for the case of extra slashes
file:////%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt
</command>
<precheck>
%PERL -e "print 'Test requires a Unix system' if ( $^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'dos' || $^O eq 'msys');"
%PERL -e "print 'Test requires a Unix system' if($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'dos' || $^O eq 'msys');"
</precheck>
<file name="%LOGDIR/test%TESTNUMBER.txt">
foo

View File

@ -102,7 +102,7 @@ Via: 2 nghttpx
* Connection #0 to host localhost left intact
</file>
<stripfile>
$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))
$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/))
</stripfile>
</verify>
</testcase>

View File

@ -102,7 +102,7 @@ Via: 2 nghttpx
* Connection #0 to host localhost left intact
</file>
<stripfile>
$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))
$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/))
</stripfile>
</verify>
</testcase>

View File

@ -97,7 +97,7 @@ Via: 3 nghttpx
== Info: Connection #0 to host localhost left intact
</file>
<stripfile>
$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))
$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/))
</stripfile>
</verify>
</testcase>

View File

@ -79,7 +79,7 @@ Set-Cookie: cookie31=%hex[%7f-junk]hex%
</file>
<precheck>
%PERL -e 'if ("%HOSTIP" !~ /\.0\.0\.1$/) {print "Test only works for HOSTIPs ending with .0.0.1"; exit(1)}'
%PERL -e 'if("%HOSTIP" !~ /\.0\.0\.1$/) {print "Test only works for HOSTIPs ending with .0.0.1"; exit(1)}'
</precheck>
<features>
cookies

View File

@ -38,7 +38,7 @@ MEM tool_cfgable.c
MEM tool_cfgable.c
</file>
<stripfile>
$_ = '' if ((($_ !~ /tool_paramhlp/) && ($_ !~ /tool_cfgable/)) || ($_ =~ /free\(\(nil\)\)/))
$_ = '' if((($_ !~ /tool_paramhlp/) && ($_ !~ /tool_cfgable/)) || ($_ =~ /free\(\(nil\)\)/))
s/:\d+.*//
s:^(MEM )(.*/)(.*):$1$3:
</stripfile>

View File

@ -35,7 +35,7 @@ my $what=$ARGV[2];
my $curl_protocols="";
open(CURL, "$ARGV[1]") || die "Can't get curl $what list\n";
while(<CURL>) {
$curl_protocols = $_ if ( /$what:/i );
$curl_protocols = $_ if(/$what:/i);
}
close CURL;

View File

@ -36,8 +36,7 @@ sub errout {
exit 1;
}
if($ARGV[0] eq "prepare")
{
if($ARGV[0] eq "prepare") {
my $dirname = $ARGV[1];
mkdir $dirname || errout "$!";
chdir $dirname;
@ -71,8 +70,7 @@ if($ARGV[0] eq "prepare")
exit 0;
}
elsif($ARGV[0] eq "postprocess")
{
elsif($ARGV[0] eq "postprocess") {
my $dirname = $ARGV[1];
my $logfile = $ARGV[2];

View File

@ -121,7 +121,7 @@ sub sys_native_abs_path {
return File::Spec->rel2abs($path) if !os_is_win();
# Do not process empty path.
return $path if ($path eq '');
return $path if($path eq '');
my $res;
if($^O eq 'msys' || $^O eq 'cygwin') {

View File

@ -305,7 +305,7 @@ delete $ENV{'CURL_CA_BUNDLE'} if($ENV{'CURL_CA_BUNDLE'});
# set by the caller
if(open(my $fd, "<", "config")) {
while(my $line = <$fd>) {
next if ($line =~ /^#/);
next if($line =~ /^#/);
chomp $line;
my ($name, $val) = split(/\s*:\s*/, $line, 2);
$ENV{$name} = $val if(!$ENV{$name});
@ -941,7 +941,7 @@ sub timestampskippedevents {
sub citest_starttestrun {
if(azure_check_environment()) {
$AZURE_RUN_ID = azure_create_test_run($ACURL);
logmsg "Azure Run ID: $AZURE_RUN_ID\n" if ($verbose);
logmsg "Azure Run ID: $AZURE_RUN_ID\n" if($verbose);
}
# Appveyor doesn't require anything here
}
@ -2294,7 +2294,7 @@ while(@ARGV) {
my $exclude_file = $ARGV[0];
open(my $fd, "<", $exclude_file) or die "Couldn't open '$exclude_file': $!";
while(my $line = <$fd>) {
next if ($line =~ /^#/);
next if($line =~ /^#/);
chomp $line;
my ($type, $patterns, $skip_reason) = split(/\s*:\s*/, $line, 3);
@ -2697,7 +2697,7 @@ sub disabledtests {
# fail hard to make user notice
exit 1;
}
logmsg "DISABLED: test $n\n" if ($verbose);
logmsg "DISABLED: test $n\n" if($verbose);
}
else {
print STDERR "$file: rubbish content: $t\n";

View File

@ -166,7 +166,7 @@ sub checkcmd {
"/sbin", "/usr/bin", "/usr/local/bin", @extrapaths);
}
for(@paths) {
if( -x "$_/$cmd" . exe_ext('SYS') && ! -d "$_/$cmd" . exe_ext('SYS')) {
if(-x "$_/$cmd" . exe_ext('SYS') && ! -d "$_/$cmd" . exe_ext('SYS')) {
# executable bit but not a directory!
return "$_/$cmd";
}
@ -345,7 +345,7 @@ sub serverfortest {
sub startnew {
my ($cmd, $pidfile, $timeout, $fakepidfile)=@_;
logmsg "startnew: $cmd\n" if ($verbose);
logmsg "startnew: $cmd\n" if($verbose);
my $child = fork();
@ -504,7 +504,7 @@ sub stopserver {
foreach my $lockfile (@lockfiles) {
if(-f $lockfile) {
unlink($lockfile);
logmsg "RUN: kill $server, cleaned up $lockfile\n" if ($verbose);
logmsg "RUN: kill $server, cleaned up $lockfile\n" if($verbose);
}
}
}
@ -3029,7 +3029,7 @@ sub startservers {
}
}
elsif($what eq "none") {
logmsg "* starts no server\n" if ($verbose);
logmsg "* starts no server\n" if($verbose);
}
else {
warn "we don't support a server for $what";

View File

@ -67,8 +67,8 @@ my %rem;
sub scanenum {
my ($file) = @_;
open my $h_in, "-|", "$Cpreprocessor $i$file" || die "Cannot preprocess $file";
while( <$h_in> ) {
if( /enum\s+(\S+\s+)?{/ .. /}/ ) {
while(<$h_in>) {
if(/enum\s+(\S+\s+)?{/ .. /}/) {
s/^\s+//;
next unless /^CURL/;
chomp;

View File

@ -22,8 +22,6 @@
# SPDX-License-Identifier: curl
#
###########################################################################
#
#
use strict;
use warnings;

View File

@ -202,7 +202,7 @@ while(<$r>) {
$list=1;
}
elsif($list) {
if( /^ \{(\"[^,]*\").*\'(.)\',/) {
if(/^ \{(\"[^,]*\").*\'(.)\',/) {
my ($l, $s)=($1, $2);
my $sh;
my $lo;

View File

@ -22,7 +22,6 @@
# SPDX-License-Identifier: curl
#
###########################################################################
#
use strict;
use warnings;

View File

@ -76,7 +76,7 @@ sub scanenums {
die "Cannot preprocess $file";
while(<H_IN>) {
my ($line, $linenum) = ($_, $.);
if( /^#(line|) (\d+) \"(.*)\"/) {
if(/^#(line|) (\d+) \"(.*)\"/) {
# if the included file isn't in our incdir, then we skip this section
# until next #line
#
@ -94,7 +94,7 @@ sub scanenums {
if(/^#/) {
next;
}
if( /enum\s+(\S+\s+)?{/ .. /}/ ) {
if(/enum\s+(\S+\s+)?{/ .. /}/) {
s/^\s+//;
chomp;
s/[,\s].*//;

View File

@ -107,7 +107,7 @@ sub checkref {
return;
}
foreach my $d (keys %docsdirs) {
if( -f "$d/$f.$sec") {
if(-f "$d/$f.$sec") {
$present = 1;
$ref{"$f.$sec"}=1;
last;

View File

@ -22,8 +22,6 @@
# SPDX-License-Identifier: curl
#
###########################################################################
#
#
use strict;
use warnings;

View File

@ -22,8 +22,6 @@
# SPDX-License-Identifier: curl
#
###########################################################################
#
#
use strict;
use warnings;

View File

@ -127,14 +127,12 @@ close $s;
my $ignored=0;
for my $e (sort @syms) {
if( $manpage{$e} ) {
if( $manpage{$e} ne $symadded{$e} ) {
if($manpage{$e}) {
if($manpage{$e} ne $symadded{$e}) {
printf "%s.md says version %s, but SIV says %s\n",
$e, $manpage{$e}, $symadded{$e};
$error++;
}
}
}
print "OK\n" if(!$error);

View File

@ -22,8 +22,6 @@
# SPDX-License-Identifier: curl
#
###########################################################################
#
#
use strict;
use warnings;

View File

@ -23,7 +23,6 @@
#
###########################################################################
#
#
# - Get all options mentioned in the $cmddir.
# - Make sure they're all mentioned in the $opts document
# - Make sure that the version in $opts matches the version in the file in

View File

@ -177,8 +177,8 @@ if(($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys') &&
$confheader = 'config-win32.h';
}
$ENV{LC_ALL}="C" if (($ENV{LC_ALL}) && ($ENV{LC_ALL} !~ /^C$/));
$ENV{LC_CTYPE}="C" if (($ENV{LC_CTYPE}) && ($ENV{LC_CTYPE} !~ /^C$/));
$ENV{LC_ALL}="C" if(($ENV{LC_ALL}) && ($ENV{LC_ALL} !~ /^C$/));
$ENV{LC_CTYPE}="C" if(($ENV{LC_CTYPE}) && ($ENV{LC_CTYPE} !~ /^C$/));
$ENV{LANG}="C";
sub rmtree($) {
@ -371,11 +371,11 @@ if(-d $CURLDIR) {
# time we run this test
unlink "$CURLDIR/src/tool_hugehelp.c";
# find out if curl source dir has an in-tree c-ares repo
$have_embedded_ares = 1 if (-f "$CURLDIR/ares/GIT-INFO");
$have_embedded_ares = 1 if(-f "$CURLDIR/ares/GIT-INFO");
} elsif(!$git && -f "$CURLDIR/tests/testcurl.pl") {
logit "$CURLDIR is verified to be a fine daily source dir";
# find out if curl source dir has an in-tree c-ares extracted tarball
$have_embedded_ares = 1 if (-f "$CURLDIR/ares/ares_build.h");
$have_embedded_ares = 1 if(-f "$CURLDIR/ares/ares_build.h");
} else {
mydie "$CURLDIR is not a daily source dir or checked out from git!"
}
@ -419,10 +419,10 @@ if($git) {
logit "run git pull in curl";
system("git pull 2>&1");
$gitstat += $?;
logit "failed to update from curl git ($?), continue anyway" if ($?);
logit "failed to update from curl git ($?), continue anyway" if($?);
# Set timestamp to the UTC the git update took place.
$timestamp = scalar(gmtime)." UTC" if (!$gitstat);
$timestamp = scalar(gmtime)." UTC" if(!$gitstat);
}
# get the last 5 commits for show (even if no pull was made)
@ -442,10 +442,10 @@ if($git) {
logit "run git pull in ares";
system("git pull 2>&1");
$gitstat += $?;
logit "failed to update from ares git ($?), continue anyway" if ($?);
logit "failed to update from ares git ($?), continue anyway" if($?);
# Set timestamp to the UTC the git update took place.
$timestamp = scalar(gmtime)." UTC" if (!$gitstat);
$timestamp = scalar(gmtime)." UTC" if(!$gitstat);
}
# get the last 5 commits for show (even if no pull was made)
@ -535,7 +535,7 @@ sub findinpath {
my @pa = split($s, $p);
for $c (@_) {
for $e (@pa) {
if( -x "$e/$c$x") {
if(-x "$e/$c$x") {
return $c;
}
}
@ -547,7 +547,7 @@ if(!$make) {
mydie "Couldn't find make in the PATH";
}
# force to 'nmake' for VC builds
$make = "nmake" if ($targetos =~ /vc/);
$make = "nmake" if($targetos =~ /vc/);
logit "going with $make as make";
# change to build dir
@ -683,7 +683,7 @@ if(!$crosscompile || (($extvercmd ne '') && (-x $extvercmd))) {
open($f, "<", $cmd);
while(<$f>) {
# strip CR from output on non-Windows platforms (WINE on Linux)
s/\r// if ($^O ne 'MSWin32');
s/\r// if($^O ne 'MSWin32');
print;
}
close($f);