From cc0b5dec60a97e782747966e9c6a1b29283fc112 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 28 Mar 2013 08:17:36 +0000 Subject: src/quote_fmt_parse.y: prohibit warnings when target message does not exist. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3238 ee746299-78ed-0310-b773-934348b2243d --- src/quote_fmt_parse.y | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'src/quote_fmt_parse.y') diff --git a/src/quote_fmt_parse.y b/src/quote_fmt_parse.y index db1aa9f2..15b2359a 100644 --- a/src/quote_fmt_parse.y +++ b/src/quote_fmt_parse.y @@ -266,16 +266,17 @@ special: | SHOW_MESSAGE { gchar buf[BUFFSIZE]; - FILE *fp; + FILE *fp = NULL; if (body) fp = str_open_as_stream(body); - else + else if (msginfo->size > 0) { fp = procmime_get_first_text_content(msginfo, NULL); + if (fp == NULL) + g_warning("quote_fmt_parse.y: Can't get text part\n"); + } - if (fp == NULL) - g_warning("Can't get text part\n"); - else { + if (fp) { while (fgets(buf, sizeof(buf), fp) != NULL) { strcrchomp(buf); INSERT(buf); @@ -286,16 +287,17 @@ special: | SHOW_QUOTED_MESSAGE { gchar buf[BUFFSIZE]; - FILE *fp; + FILE *fp = NULL; if (body) fp = str_open_as_stream(body); - else + else if (msginfo->size > 0) { fp = procmime_get_first_text_content(msginfo, NULL); + if (fp == NULL) + g_warning("quote_fmt_parse.y: Can't get text part\n"); + } - if (fp == NULL) - g_warning("Can't get text part\n"); - else { + if (fp) { while (fgets(buf, sizeof(buf), fp) != NULL) { strcrchomp(buf); if (quote_str) @@ -308,16 +310,17 @@ special: | SHOW_MESSAGE_NO_SIGNATURE { gchar buf[BUFFSIZE]; - FILE *fp; + FILE *fp = NULL; if (body) fp = str_open_as_stream(body); - else + else if (msginfo->size > 0) { fp = procmime_get_first_text_content(msginfo, NULL); + if (fp == NULL) + g_warning("quote_fmt_parse.y: Can't get text part\n"); + } - if (fp == NULL) - g_warning("Can't get text part\n"); - else { + if (fp) { while (fgets(buf, sizeof(buf), fp) != NULL) { strcrchomp(buf); if (strncmp(buf, "-- \n", 4) == 0) @@ -330,16 +333,17 @@ special: | SHOW_QUOTED_MESSAGE_NO_SIGNATURE { gchar buf[BUFFSIZE]; - FILE *fp; + FILE *fp = NULL; if (body) fp = str_open_as_stream(body); - else + else if (msginfo->size > 0) { fp = procmime_get_first_text_content(msginfo, NULL); + if (fp == NULL) + g_warning("Can't get text part\n"); + } - if (fp == NULL) - g_warning("Can't get text part\n"); - else { + if (fp) { while (fgets(buf, sizeof(buf), fp) != NULL) { strcrchomp(buf); if (strncmp(buf, "-- \n", 4) == 0) -- cgit v1.2.3