checksrc: warn on empty line before open brace
... and fix a few occurances Closes #6088
This commit is contained in:
Родитель
b7ea3d2c22
Коммит
475c1aba68
|
@ -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 =~ /^(.*[^ ].*) ;$/) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче