From 7b96563a057ac5cf96cb2b3e9a0df9e1c84ac0cc Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 6 Apr 2026 03:32:30 +0200 Subject: [PATCH] spacecheck.pl: fix to check 3+ newlines in all files Follow-up to e52e6dac8e83dd06306e3e9eca32a39575e8fec6 #20269 Closes #21237 --- lib/hostip.h | 4 ---- scripts/spacecheck.pl | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/hostip.h b/lib/hostip.h index 2c72db6de4..a948fba9e7 100644 --- a/lib/hostip.h +++ b/lib/hostip.h @@ -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 diff --git a/scripts/spacecheck.pl b/scripts/spacecheck.pl index f1eb4a8992..416408e56e 100755 --- a/scripts/spacecheck.pl +++ b/scripts/spacecheck.pl @@ -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)) {