mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
spacecheck.pl: fix to check 3+ newlines in all files
Follow-up to e52e6dac8e #20269
Closes #21237
This commit is contained in:
parent
e078485b36
commit
7b96563a05
@ -162,11 +162,8 @@ bool Curl_resolv_knows_https(struct Curl_easy *data, uint32_t resolv_id);
|
||||
#define Curl_resolv_destroy(x,y) Curl_nop_stmt
|
||||
#endif /* USE_CURL_ASYNC, else */
|
||||
|
||||
|
||||
CURLcode Curl_resolver_error(struct Curl_easy *data, const char *detail);
|
||||
|
||||
|
||||
|
||||
#ifdef CURLRES_SYNCH
|
||||
/*
|
||||
* Curl_sync_getaddrinfo() is the non-async low-level name resolve API.
|
||||
@ -178,7 +175,6 @@ struct Curl_addrinfo *Curl_sync_getaddrinfo(struct Curl_easy *data,
|
||||
const char *hostname,
|
||||
uint16_t port,
|
||||
uint8_t transport);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef USE_UNIX_SOCKETS
|
||||
|
||||
@ -199,6 +199,26 @@ while(my $filename = <$git_ls_files>) {
|
||||
}
|
||||
}
|
||||
|
||||
if($content =~ /\n\n\n\n/ ||
|
||||
$content =~ /\r\n\r\n\r\n\r\n/) {
|
||||
my $line = 0;
|
||||
my $blank = 0;
|
||||
for my $l (split(/\n/, $content)) {
|
||||
chomp $l;
|
||||
$line++;
|
||||
if($l =~ /^$/) {
|
||||
if($blank > 1) {
|
||||
my $lineno = sprintf('3 or more consecutive empty lines @ line %d', $line);
|
||||
push @err, $lineno;
|
||||
}
|
||||
$blank++;
|
||||
}
|
||||
else {
|
||||
$blank = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!fn_match($filename, @longline)) {
|
||||
my $line = 0;
|
||||
for my $l (split(/\n/, $content)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user