From 66b077576313eda129bce9f58fdc894d857cb121 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 13 May 2020 12:56:53 +0200 Subject: checksrc: enhance the ASTERISKSPACE and update code accordingly Fine: "struct hello *world" Not fine: "struct hello* world" (and variations) Closes #5386 --- lib/checksrc.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/checksrc.pl') diff --git a/lib/checksrc.pl b/lib/checksrc.pl index df93696d7..cbd204adb 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -640,10 +640,10 @@ sub scanfile { } # check for 'char * name' - if(($l =~ /(^.*(char|int|long|void|curl_slist|CURL|CURLM|CURLMsg|curl_httppost) *(\*+)) (\w+)/) && ($4 ne "const")) { - checkwarn("ASTERISKNOSPACE", + if(($l =~ /(^.*(char|int|long|void|CURL|CURLM|CURLMsg|[cC]url_[A-Za-z_]+|struct [a-zA-Z_]+) *(\*+)) (\w+)/) && ($4 !~ /^(const|volatile)$/)) { + checkwarn("ASTERISKSPACE", $line, length($1), $file, $ol, - "no space after declarative asterisk"); + "space after declarative asterisk"); } # check for 'char*' if(($l =~ /(^.*(char|int|long|void|curl_slist|CURL|CURLM|CURLMsg|curl_httppost|sockaddr_in|FILE)\*)/)) { -- cgit v1.2.3