[PATCH] gpg: Fix misleading log message when checking regexp.

Damien Goutte-Gattat dgouttegattat at incenp.org
Tue Jan 17 20:42:09 CET 2017


* src/trustdb.c (check_regexp): Correctly print whether the
regexp matched or not.
--

This patch fixes the log message displayed when gpg attempts to
match the regexp associated with a trust signature with an user ID.
The current message interprets the 'ret' variable backwards, and
displays 'YES' when the regexp actually fails to match.

Signed-off-by: Damien Goutte-Gattat <dgouttegattat at incenp.org>
---
 g10/trustdb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/g10/trustdb.c b/g10/trustdb.c
index c113b7e..75714ab 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -1550,14 +1550,14 @@ check_regexp(const char *expr,const char *string)
       {
 	ret=regexec(&pat,string,0,NULL,0);
 	regfree(&pat);
-	ret=(ret==0);
       }
+    ret=(ret==0);
   }
 #endif
 
   if(DBG_TRUST)
     log_debug("regexp '%s' ('%s') on '%s': %s\n",
-	      regexp,expr,string,ret==0?"YES":"NO");
+	      regexp,expr,string,ret?"YES":"NO");
 
   xfree(regexp);
 
-- 
2.9.0




More information about the Gnupg-devel mailing list