1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

checksrc: warn on empty line before open brace

... and fix a few occurances

Closes #6088
This commit is contained in:
Daniel Stenberg 2020-10-15 15:30:55 +02:00
parent b7ea3d2c22
commit 475c1aba68
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
6 changed files with 6 additions and 6 deletions

View File

@ -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 =~ /^(.*[^ ].*) ;$/) {

View File

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

View File

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

View File

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

View File

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

View File

@ -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");
}