diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2013-03-28 08:17:36 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2013-03-28 08:17:36 +0000 |
commit | cc0b5dec60a97e782747966e9c6a1b29283fc112 (patch) | |
tree | 679600b40e20018a5fba86de617413e8f0da926a /src | |
parent | ab12b119ff05a3012bc3d92349bddd3f66fc09e6 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/quote_fmt_parse.y | 44 |
1 files changed, 24 insertions, 20 deletions
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) |