gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnurl] 249/411: checksrc: warn on empty line before open brace


From: gnunet
Subject: [gnurl] 249/411: checksrc: warn on empty line before open brace
Date: Wed, 13 Jan 2021 01:21:04 +0100

This is an automated email from the git hooks/post-receive script.

nikita pushed a commit to branch master
in repository gnurl.

commit 475c1aba68030bc21b8d0ed76a7028eb2e797f64
Author: Daniel Stenberg <daniel@haxx.se>
AuthorDate: Thu Oct 15 15:30:55 2020 +0200

    checksrc: warn on empty line before open brace
    
    ... and fix a few occurances
    
    Closes #6088
---
 lib/checksrc.pl       | 6 ++++++
 lib/ftp.c             | 1 -
 lib/multi.c           | 1 -
 lib/vauth/ntlm.c      | 1 -
 lib/vtls/openssl.c    | 1 -
 tests/unit/unit1604.c | 2 --
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/checksrc.pl b/lib/checksrc.pl
index 78b9cef5b..126f3c77e 100755
--- a/lib/checksrc.pl
+++ b/lib/checksrc.pl
@@ -85,6 +85,7 @@ my %warnings = (
     'DOBRACE'          => 'A single space between do and open brace',
     'BRACEWHILE'       => 'A single space between open brace and while',
     'EXCLAMATIONSPACE' => 'Whitespace after exclamation mark in expression',
+    'EMPTYLINEBRACE'   => 'Empty line before the open brace',
     );
 
 sub readskiplist {
@@ -594,6 +595,11 @@ sub scanfile {
             checkwarn("PARENBRACE",
                       $line, length($1)+1, $file, $l, "missing space after 
close paren");
         }
+        # check for "^{" with an empty line before it
+        if(($l =~ /^\{/) && ($prevl =~ /^[ \t]*\z/)) {
+            checkwarn("EMPTYLINEBRACE",
+                      $line, 0, $file, $l, "empty line before open brace");
+        }
 
         # check for space before the semicolon last in a line
         if($l =~ /^(.*[^ ].*) ;$/) {
diff --git a/lib/ftp.c b/lib/ftp.c
index 11031da6f..46533c71b 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -901,7 +901,6 @@ typedef enum {
 
 static CURLcode ftp_state_use_port(struct connectdata *conn,
                                    ftpport fcmd) /* start with this */
-
 {
   CURLcode result = CURLE_OK;
   struct ftp_conn *ftpc = &conn->proto.ftpc;
diff --git a/lib/multi.c b/lib/multi.c
index 4cc7c5ae6..9f7de97be 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -3158,7 +3158,6 @@ CURLMcode curl_multi_socket_action(struct Curl_multi 
*multi, curl_socket_t s,
 }
 
 CURLMcode curl_multi_socket_all(struct Curl_multi *multi, int *running_handles)
-
 {
   CURLMcode result;
   if(multi->in_callback)
diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c
index ecfeacb9a..540ac9482 100644
--- a/lib/vauth/ntlm.c
+++ b/lib/vauth/ntlm.c
@@ -497,7 +497,6 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct 
Curl_easy *data,
                                              const char *passwdp,
                                              struct ntlmdata *ntlm,
                                              char **outptr, size_t *outlen)
-
 {
   /* NTLM type-3 message structure:
 
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 28a1ae6da..76d0bc413 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -3453,7 +3453,6 @@ typedef int numcert_t;
 
 static CURLcode get_cert_chain(struct connectdata *conn,
                                struct ssl_connect_data *connssl)
-
 {
   CURLcode result;
   STACK_OF(X509) *sk;
diff --git a/tests/unit/unit1604.c b/tests/unit/unit1604.c
index 9c4f77670..74366d11f 100644
--- a/tests/unit/unit1604.c
+++ b/tests/unit/unit1604.c
@@ -82,7 +82,6 @@ struct data {
 };
 
 UNITTEST_START
-
 { /* START sanitize_file_name */
   struct data data[] = {
     { "", 0,
@@ -349,7 +348,6 @@ UNITTEST_START
 
 #else
 UNITTEST_START
-
 {
   fprintf(stderr, "Skipped test not for this platform\n");
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]