[Commits] [SCM] claws branch, new-rssyl, updated. 3.10.1-15-gc3b5597

Colin colin at claws-mail.org
Thu Jun 12 09:50:36 CEST 2014


The branch new-rssyl of project "claws" (Claws Mail) has been updated
       via  c3b559782068f4c4642a8e7d34e3ba8664076106 (commit)
      from  c0514faaddb5bd97f44197471018f711ec1f480a (commit)


- Log -----------------------------------------------------------------
commit c3b559782068f4c4642a8e7d34e3ba8664076106
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 12 09:50:34 2014 +0200

    Fix wrong replace in default strings, introduced by
    a Coverity fix

diff --git a/src/wizard.c b/src/wizard.c
index 0974120..717bb9f 100644
--- a/src/wizard.c
+++ b/src/wizard.c
@@ -328,8 +328,8 @@ static gchar *get_name_for_mail(void)
 #define PARSE_DEFAULT(str) {	\
 	gchar *tmp = NULL, *new = NULL;	\
 	if (str != NULL) {	\
-		tmp = g_strdup(str);	\
-		if (strstr(tmp, "$USERNAME")) {	\
+		if (strstr(str, "$USERNAME")) {	\
+			tmp = g_strdup(str); \
 			*strstr(tmp, "$USERNAME") = '\0';	\
 			new = g_strconcat(tmp, g_get_real_name(), 	\
 				strstr(str, "$USERNAME")+strlen("$USERNAME"), 	\
@@ -339,7 +339,8 @@ static gchar *get_name_for_mail(void)
 			str = new;	\
 			new = NULL;	\
 		}	\
-		if (strstr(tmp, "$LOGIN")) {	\
+		if (strstr(str, "$LOGIN")) {	\
+			tmp = g_strdup(str); \
 			*strstr(tmp, "$LOGIN") = '\0';	\
 			new = g_strconcat(tmp, g_get_user_name(), 	\
 				strstr(str, "$LOGIN")+strlen("$LOGIN"), 	\
@@ -349,7 +350,8 @@ static gchar *get_name_for_mail(void)
 			str = new;	\
 			new = NULL;	\
 		}	\
-		if (strstr(tmp, "$EMAIL")) {	\
+		if (strstr(str, "$EMAIL")) {	\
+			tmp = g_strdup(str); \
 			*strstr(tmp, "$EMAIL") = '\0';	\
 			new = g_strconcat(tmp, tmpl.email, 	\
 				strstr(str, "$EMAIL")+strlen("$EMAIL"), 	\
@@ -359,7 +361,8 @@ static gchar *get_name_for_mail(void)
 			str = new;	\
 			new = NULL;	\
 		}	\
-		if (strstr(tmp, "$NAME_MAIL")) {	\
+		if (strstr(str, "$NAME_MAIL")) {	\
+			tmp = g_strdup(str); \
 			*strstr(tmp, "$NAME_MAIL") = '\0';	\
 			new = g_strconcat(tmp, get_name_for_mail(), 	\
 				strstr(str, "$NAME_MAIL")+strlen("$NAME_MAIL"), 	\
@@ -369,7 +372,8 @@ static gchar *get_name_for_mail(void)
 			str = new;	\
 			new = NULL;	\
 		}	\
-		if (strstr(tmp, "$DEFAULTDOMAIN")) {	\
+		if (strstr(str, "$DEFAULTDOMAIN")) {	\
+			tmp = g_strdup(str); \
 			*strstr(tmp, "$DEFAULTDOMAIN") = '\0';	\
 			new = g_strconcat(tmp, wizard_get_default_domain_name(), 	\
 				strstr(str, "$DEFAULTDOMAIN")+strlen("$DEFAULTDOMAIN"), 	\
@@ -379,7 +383,8 @@ static gchar *get_name_for_mail(void)
 			str = new;	\
 			new = NULL;	\
 		}	\
-		if (strstr(tmp, "$DOMAIN")) {	\
+		if (strstr(str, "$DOMAIN")) {	\
+			tmp = g_strdup(str); \
 			*strstr(tmp, "$DOMAIN") = '\0';	\
 			new = g_strconcat(tmp, tmpl.domain, 	\
 				strstr(str, "$DOMAIN")+strlen("$DOMAIN"), 	\

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

Summary of changes:
 src/wizard.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list