[Commits] [SCM] claws branch, gtk2, updated. 3.20.0-64-g93faac983

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


The branch, gtk2 has been updated
       via  93faac983e69c0c2bd94261ba8a8ec3489afe1fd (commit)
      from  883f75cbd0d63b8349610afba155dd80e31575ac (commit)

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


- Log -----------------------------------------------------------------
commit 93faac983e69c0c2bd94261ba8a8ec3489afe1fd
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