[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 64/151: checksrc: fix regexp for ASSIGNWITHINCONDITION
From: |
gnunet |
Subject: |
[gnurl] 64/151: checksrc: fix regexp for ASSIGNWITHINCONDITION |
Date: |
Fri, 20 Dec 2019 14:26:13 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit ba82673dac3e8d00a76aa5e3779a0cb80e7442af
Author: Daniel Gustafsson <address@hidden>
AuthorDate: Thu Nov 28 14:16:02 2019 +0100
checksrc: fix regexp for ASSIGNWITHINCONDITION
The regexp looking for assignments within conditions was too greedy
and matched a too long string in the case of multiple conditionals
on the same line. This is basically only a problem in single line
macros, and the code which exemplified this was essentially:
do { if((x) != NULL) { x = NULL; } } while(0)
..where the final parenthesis of while(0) matched the regexp, and
the legal assignment in the block triggered the warning. Fix by
making the regexp less greedy by matching for the tell-tale signs
of the if statement ending.
Also remove the one occurrence where the warning was disabled due
to a construction like the above, where the warning didn't apply
when fixed.
Closes #4647
Reviewed-by: Daniel Stenberg <address@hidden>
---
lib/checksrc.pl | 2 +-
lib/vssh/libssh.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/checksrc.pl b/lib/checksrc.pl
index 834364561..db9a45dff 100755
--- a/lib/checksrc.pl
+++ b/lib/checksrc.pl
@@ -457,7 +457,7 @@ sub scanfile {
}
}
- if($nostr =~ /^((.*)(if) *\()(.*)\)/) {
+ if($nostr =~ /^((.*)(if) *\()(.*)\) [{\n]/) {
my $pos = length($1);
if($4 =~ / = /) {
checkwarn("ASSIGNWITHINCONDITION",
diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c
index cad8b3786..070879d94 100644
--- a/lib/vssh/libssh.c
+++ b/lib/vssh/libssh.c
@@ -97,7 +97,6 @@
/* A recent macro provided by libssh. Or make our own. */
#ifndef SSH_STRING_FREE_CHAR
-/* !checksrc! disable ASSIGNWITHINCONDITION 1 */
#define SSH_STRING_FREE_CHAR(x) \
do { if((x) != NULL) { ssh_string_free_char(x); x = NULL; } } while(0)
#endif
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 54/151: curl: fix --upload-file . hangs if delay in STDIN, (continued)
- [gnurl] 54/151: curl: fix --upload-file . hangs if delay in STDIN, gnunet, 2019/12/20
- [gnurl] 47/151: projects: Fix Visual Studio projects SSH builds, gnunet, 2019/12/20
- [gnurl] 56/151: travis: export the CC/CXX variables when set, gnunet, 2019/12/20
- [gnurl] 57/151: ngtcp2: fix thread-safety bug in error-handling, gnunet, 2019/12/20
- [gnurl] 60/151: mailmap: Niall O'Reilly's name, gnunet, 2019/12/20
- [gnurl] 61/151: docs: fix typos, gnunet, 2019/12/20
- [gnurl] 38/151: projects: Fix Visual Studio wolfSSL configurations, gnunet, 2019/12/20
- [gnurl] 53/151: XFERINFOFUNCTION: support CURL_PROGRESSFUNC_CONTINUE, gnunet, 2019/12/20
- [gnurl] 66/151: curl_setup_once: consistently use WHILE_FALSE in macros, gnunet, 2019/12/20
- [gnurl] 48/151: checksrc.bat: Add a check for vquic and vssh directories, gnunet, 2019/12/20
- [gnurl] 64/151: checksrc: fix regexp for ASSIGNWITHINCONDITION,
gnunet <=
- [gnurl] 58/151: travis: build ngtcp2 with --enable-lib-only, gnunet, 2019/12/20
- [gnurl] 51/151: curl_multi_wakeup.3: add example and AVAILABILITY, gnunet, 2019/12/20
- [gnurl] 55/151: dist: add error-codes.pl, gnunet, 2019/12/20
- [gnurl] 63/151: RELEASE-NOTES: synced, gnunet, 2019/12/20
- [gnurl] 59/151: doh: use dedicated probe slots, gnunet, 2019/12/20
- [gnurl] 62/151: curl: two new command line options for etags, gnunet, 2019/12/20
- [gnurl] 70/151: global_init: undo the "intialized" bump in case of failure, gnunet, 2019/12/20
- [gnurl] 67/151: sha256: bump the copyright year range, gnunet, 2019/12/20
- [gnurl] 50/151: multi: add curl_multi_wakeup(), gnunet, 2019/12/20
- [gnurl] 69/151: parsedate: offer a getdate_capped() alternative, gnunet, 2019/12/20