talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 64e5421bb2a0dbad5d23a6c292d84a96cb3050e2
parent 46c8c40814ef39791f264a721c29563b06976cf7
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Sun, 17 May 2015 19:13:17 +0200

RSSyl: Strip leading and trailing whitespace from XML tag contents.

Diffstat:
Msrc/plugins/rssyl/libfeed/parser_atom10.c | 3++-
Msrc/plugins/rssyl/libfeed/parser_rdf.c | 3++-
Msrc/plugins/rssyl/libfeed/parser_rss20.c | 3++-
3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/plugins/rssyl/libfeed/parser_atom10.c b/src/plugins/rssyl/libfeed/parser_atom10.c @@ -107,7 +107,7 @@ void feed_parser_atom10_end(void *data, const gchar *el) gchar *text = NULL, *tmp; if( ctx->str != NULL ) - text = ctx->str->str; + text = g_strstrip(g_strdup(ctx->str->str)); else text = ""; @@ -253,6 +253,7 @@ void feed_parser_atom10_end(void *data, const gchar *el) } if( ctx->str != NULL ) { + g_free(text); g_string_free(ctx->str, TRUE); ctx->str = NULL; } diff --git a/src/plugins/rssyl/libfeed/parser_rdf.c b/src/plugins/rssyl/libfeed/parser_rdf.c @@ -57,7 +57,7 @@ void feed_parser_rdf_end(void *data, const gchar *el) gchar *text = NULL; if( ctx->str != NULL ) - text = ctx->str->str; + text = g_strstrip(g_strdup(ctx->str->str)); else text = ""; @@ -142,6 +142,7 @@ void feed_parser_rdf_end(void *data, const gchar *el) } if( ctx->str != NULL ) { + g_free(text); g_string_free(ctx->str, TRUE); ctx->str = NULL; } diff --git a/src/plugins/rssyl/libfeed/parser_rss20.c b/src/plugins/rssyl/libfeed/parser_rss20.c @@ -80,7 +80,7 @@ void feed_parser_rss20_end(void *data, const gchar *el) gchar *text = NULL; if( ctx->str != NULL ) - text = ctx->str->str; + text = g_strstrip(g_strdup(ctx->str->str)); else text = ""; @@ -174,6 +174,7 @@ void feed_parser_rss20_end(void *data, const gchar *el) } if( ctx->str != NULL ) { + g_free(text); g_string_free(ctx->str, TRUE); ctx->str = NULL; }