[Commits] [SCM] claws branch, master, updated. 4.2.0-64-g8929ba02d

wwp at claws-mail.org wwp at claws-mail.org
Thu Feb 29 00:39:11 CET 2024


The branch, master has been updated
       via  8929ba02d72822f01966fb824b3f0afb40dca2a7 (commit)
      from  288a1eed4e5a1c723a6e9f4848e53bae77c674dc (commit)

Summary of changes:
 src/matcher.c | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)


- Log -----------------------------------------------------------------
commit 8929ba02d72822f01966fb824b3f0afb40dca2a7
Author: wwp <subscript at free.fr>
Date:   Thu Feb 29 00:39:09 2024 +0100

    fix bug 4747, 'matcher: simplify matcherprop_new' (mostly by Olaf Hering)

diff --git a/src/matcher.c b/src/matcher.c
index 32a9158bc..99d8221cc 100644
--- a/src/matcher.c
+++ b/src/matcher.c
@@ -311,20 +311,15 @@ MatcherProp *matcherprop_new(gint criteria, const gchar *header,
 			      gint matchtype, const gchar *expr,
 			      int value)
 {
-	MatcherProp *prop;
+	MatcherProp *prop = g_new0(MatcherProp, 1);
 
- 	prop = g_new0(MatcherProp, 1);
 	prop->criteria = criteria;
-	prop->header = header != NULL ? g_strdup(header) : NULL;
-
-	prop->expr = expr != NULL ? g_strdup(expr) : NULL;
-
 	prop->matchtype = matchtype;
-	prop->preg = NULL;
-	prop->casefold_expr = NULL;
 	prop->value = value;
-	prop->error = 0;
-
+	if (header)
+		prop->header = g_strdup(header);
+	if (expr)
+	    prop->expr = g_strdup(expr);
 	return prop;
 }
 
@@ -358,14 +353,15 @@ MatcherProp *matcherprop_copy(const MatcherProp *src)
 	MatcherProp *prop = g_new0(MatcherProp, 1);
 	
 	prop->criteria = src->criteria;
-	prop->header = src->header ? g_strdup(src->header) : NULL;
-	prop->expr = src->expr ? g_strdup(src->expr) : NULL;
 	prop->matchtype = src->matchtype;
-	
-	prop->preg = NULL; /* will be re-evaluated */
-	prop->casefold_expr = src->casefold_expr ? g_strdup(src->casefold_expr) : NULL;
 	prop->value = src->value;
 	prop->error = src->error;	
+	if (src->header)
+		prop->header = g_strdup(src->header);
+	if (src->expr)
+		prop->expr = g_strdup(src->expr);
+	if (src->casefold_expr)
+		prop->casefold_expr = g_strdup(src->casefold_expr);
 	return prop;		
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list