From a85731ada2d361eacddc5ae92f80d34792dd4b5e Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Tue, 17 Jan 2017 20:42:09 +0100 Subject: [PATCH] gpg: Fix misleading log message when checking regexp. * 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 --- g10/trustdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/g10/trustdb.c b/g10/trustdb.c index c113b7e9d..75714ab6e 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);