spacecheck.pl: fix to check 3+ newlines in all files

Follow-up to e52e6dac8e #20269

Closes #21237
This commit is contained in:
Viktor Szakats 2026-04-06 03:32:30 +02:00
parent e078485b36
commit 7b96563a05
No known key found for this signature in database
2 changed files with 20 additions and 4 deletions

View File

@ -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

View File

@ -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)) {