[Commits] [SCM] claws branch, master, updated. 3.17.3-171-gd405b9c

ticho at claws-mail.org ticho at claws-mail.org
Tue Apr 30 23:02:56 CEST 2019


The branch, master has been updated
       via  d405b9c5472922f089c200eae12d27911950f358 (commit)
      from  6787210ce7906afcc93460c7e63c788872fa37a4 (commit)

Summary of changes:
 src/plugins/rssyl/parse822.c       |   10 ++++------
 src/plugins/rssyl/rssyl_add_item.c |    3 ++-
 2 files changed, 6 insertions(+), 7 deletions(-)


- Log -----------------------------------------------------------------
commit d405b9c5472922f089c200eae12d27911950f358
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Tue Apr 30 23:02:18 2019 +0200

    Fix parsing items with empty bodies from on-disk RSSyl items

diff --git a/src/plugins/rssyl/parse822.c b/src/plugins/rssyl/parse822.c
index 1c89c77..51cb313 100644
--- a/src/plugins/rssyl/parse822.c
+++ b/src/plugins/rssyl/parse822.c
@@ -198,6 +198,7 @@ FeedItem *rssyl_parse_folder_item_file(gchar *path)
 			if( !strcmp(lines[i], RSSYL_TEXT_START) ) {
 				debug_print("RSSyl: Leading html tag found at line %d\n", i);
 				past_html_tag = TRUE;
+				body = g_string_new("");
 				i++;
 				continue;
 			}
@@ -208,12 +209,9 @@ FeedItem *rssyl_parse_folder_item_file(gchar *path)
 					continue;
 				}
 
-				if (body) {
+				if (body->len > 0)
 					body = g_string_append_c(body, '\n');
-					body = g_string_append(body, lines[i]);
-				} else {
-					body = g_string_new(lines[i]);
-				}
+				body = g_string_append(body, lines[i]);
 
 				i++;
 			}
@@ -224,7 +222,7 @@ FeedItem *rssyl_parse_folder_item_file(gchar *path)
 	}
 
 	if (body != NULL ) {
-		if (past_endhtml_tag && body->str != NULL && body->len > 0)
+		if (past_html_tag && past_endhtml_tag && body->str != NULL)
 			feed_item_set_text(item, body->str);
 		g_string_free(body, TRUE);
 	}
diff --git a/src/plugins/rssyl/rssyl_add_item.c b/src/plugins/rssyl/rssyl_add_item.c
index d22e1dd..c40c9cd 100644
--- a/src/plugins/rssyl/rssyl_add_item.c
+++ b/src/plugins/rssyl/rssyl_add_item.c
@@ -542,7 +542,8 @@ void rssyl_add_item(RFolderItem *ritem, FeedItem *feed_item)
 			(heading ? heading : ""),
 			(tmpurl ? tmpurl : ""),
 			(tmpurl ? tmpurl : "n/a"),
-			(text ? text : ""), (text ? "\n" : "") );
+			(text ? text : ""),
+			(text && strlen(text) > 0 ? "\n" : "") );
 
 	g_free(meta_charset);
 	g_free(baseurl);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list