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;
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;
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;
$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;
# Accept-list
push @alist, $1;
}
- elsif (/^banfunc ([^ ]*)/) {
+ elsif(/^banfunc ([^ ]*)/) {
$banfunc{$1} = $1;
}
- elsif (/^allowfunc ([^ ]*)/) {
+ elsif(/^allowfunc ([^ ]*)/) {
undef $banfunc{$1};
}
else {
do {
if("$wlist" !~ / $file /) {
my $fullname = $file;
- $fullname = "$dir/$file" if ($fullname !~ '^\.?\.?/');
+ $fullname = "$dir/$file" if($fullname !~ '^\.?\.?/');
scanfile($fullname);
}
$file = shift @ARGV;
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);
$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;
my $option = '';
- if ($shell eq 'fish') {
+ if($shell eq 'fish') {
$option .= "complete --command curl";
$option .= " --short-option '" . strip_dash(trim($short)) . "'"
if defined $short;
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)'";
}
}
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;
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++;
.\\"
.TH curl 1 "$date" "curl $version" "curl Manual"
HEADER
- if ($manpage);
+ if($manpage);
while(<$fh>) {
my $f = $_;
}
}
-exit 1 if ($error);
+exit 1 if($error);
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();
}
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;
$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";
}
my %exist;
my %uses;
my $file;
-while (<N>) {
+while(<N>) {
my $l = $_;
chomp $l;
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'}));
}
"/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";
}
HEAD
;
-while (<STDIN>) {
+while(<STDIN>) {
my $line = $_;
foreach my $n (split //, $line) {
my $ord = ord($n);
push @out, " | (__| |_| | _ <| |___\n";
push @out, " \\___|\\___/|_| \\_\\_____|\n";
-while (<STDIN>) {
+while(<STDIN>) {
my $line = $_;
push @out, $line;
}
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)
}
' \\
'$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;
}
}
' \\
'$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' \\
}
' \\
'$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);
}
}
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>
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>
-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>
* Connection #3 to host server4.example.com left intact
</file>
<stripfile>
-$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))
+$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/))
</stripfile>
</verify>
</testcase>
* Connection #3 to host server4.example.com left intact
</file>
<stripfile>
-$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))
+$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/))
</stripfile>
</verify>
</testcase>
^Host:.*
</strip>
<stripfile>
-$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))
+$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/))
</stripfile>
</verify>
</testcase>
== 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>
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
* Connection #0 to host localhost left intact
</file>
<stripfile>
-$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))
+$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/))
</stripfile>
</verify>
</testcase>
* Connection #0 to host localhost left intact
</file>
<stripfile>
-$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))
+$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/))
</stripfile>
</verify>
</testcase>
== Info: Connection #0 to host localhost left intact
</file>
<stripfile>
-$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))
+$_ = '' if(($_ !~ /left intact/) && ($_ !~ /Closing connection/))
</stripfile>
</verify>
</testcase>
</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
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>
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;
exit 1;
}
-if($ARGV[0] eq "prepare")
-{
+if($ARGV[0] eq "prepare") {
my $dirname = $ARGV[1];
mkdir $dirname || errout "$!";
chdir $dirname;
exit 0;
}
-elsif($ARGV[0] eq "postprocess")
-{
+elsif($ARGV[0] eq "postprocess") {
my $dirname = $ARGV[1];
my $logfile = $ARGV[2];
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') {
# 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});
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
}
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);
# 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";
"/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";
}
sub startnew {
my ($cmd, $pidfile, $timeout, $fakepidfile)=@_;
- logmsg "startnew: $cmd\n" if ($verbose);
+ logmsg "startnew: $cmd\n" if($verbose);
my $child = fork();
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);
}
}
}
}
}
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";
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;
# SPDX-License-Identifier: curl
#
###########################################################################
-#
-#
use strict;
use warnings;
$list=1;
}
elsif($list) {
- if( /^ \{(\"[^,]*\").*\'(.)\',/) {
+ if(/^ \{(\"[^,]*\").*\'(.)\',/) {
my ($l, $s)=($1, $2);
my $sh;
my $lo;
# SPDX-License-Identifier: curl
#
###########################################################################
-#
use strict;
use warnings;
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
#
if(/^#/) {
next;
}
- if( /enum\s+(\S+\s+)?{/ .. /}/ ) {
+ if(/enum\s+(\S+\s+)?{/ .. /}/) {
s/^\s+//;
chomp;
s/[,\s].*//;
return;
}
foreach my $d (keys %docsdirs) {
- if( -f "$d/$f.$sec") {
+ if(-f "$d/$f.$sec") {
$present = 1;
$ref{"$f.$sec"}=1;
last;
# SPDX-License-Identifier: curl
#
###########################################################################
-#
-#
use strict;
use warnings;
# SPDX-License-Identifier: curl
#
###########################################################################
-#
-#
use strict;
use warnings;
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);
# SPDX-License-Identifier: curl
#
###########################################################################
-#
-#
use strict;
use warnings;
#
###########################################################################
#
-#
# - 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
$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($) {
# 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!"
}
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)
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)
my @pa = split($s, $p);
for $c (@_) {
for $e (@pa) {
- if( -x "$e/$c$x") {
+ if(-x "$e/$c$x") {
return $c;
}
}
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
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);