From: Paul Mangan Date: Fri, 31 Jan 2003 14:37:59 +0000 (+0000) Subject: sync with 0.8.9cvs4 X-Git-Tag: rel_0_8_10~35 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=9da34455f069a81dd454e3f629847a5a7d693532 sync with 0.8.9cvs4 --- diff --git a/ChangeLog b/ChangeLog index 4f70cab6b..b664c79f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-01-31 + + * src/codeconv.c: conv_iconv_strdup() + src/imap.c: + imap_modified_utf7_to_locale() + imap_locale_to_modified_utf7(): use ICONV_CONST macro to remove + a warning on some systems. + * src/codeconv.c: conv_iconv_strdup(): flush iconv() output and + truncate buffer. + Return NULL instead of incomplete string if conversion failed. + 2003-01-30 * src/summaryview.c: summary_execute(): select appropriate node diff --git a/ChangeLog.claws b/ChangeLog.claws index 0401d9c2b..7f2f74f4c 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,8 @@ +2003-01-31 [paul] 0.8.9claws28 + + * sync with 0.8.9cvs4 + see ChangeLog 2003-01-31 + 2003-01-31 [alfons] 0.8.9claws27 * src/textview.c diff --git a/ChangeLog.jp b/ChangeLog.jp index 3b598584a..eee8c2b54 100644 --- a/ChangeLog.jp +++ b/ChangeLog.jp @@ -1,3 +1,14 @@ +2003-01-31 + + * src/codeconv.c: conv_iconv_strdup() + src/imap.c: + imap_modified_utf7_to_locale() + imap_locale_to_modified_utf7(): ¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç·Ù¹ð¤ò½üµî + ¤¹¤ë¤¿¤á¤Ë ICONV_CONST ¥Þ¥¯¥í¤ò»ÈÍÑ¡£ + * src/codeconv.c: conv_iconv_strdup(): iconv() ¤Î½ÐÎϤò¥Õ¥é¥Ã¥·¥å + ¤·¡¢¥Ð¥Ã¥Õ¥¡¤òÀÚ¤êµÍ¤á¤ë¤è¤¦¤Ë¤·¤¿¡£ + ÊÑ´¹¤Ë¼ºÇÔ¤·¤¿¤éÉÔ´°Á´¤Êʸ»úÎó¤ÎÂå¤ï¤ê¤Ë NULL ¤òÊÖ¤¹¤è¤¦¤Ë¤·¤¿¡£ + 2003-01-30 * src/summaryview.c: summary_execute(): ¸½ºßÁªÂò¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤¬ diff --git a/configure.ac b/configure.ac index 32d149f75..aa26ecc72 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=8 MICRO_VERSION=9 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws27 +EXTRA_VERSION=claws28 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/codeconv.c b/src/codeconv.c index d12e56608..f6b3d4185 100644 --- a/src/codeconv.c +++ b/src/codeconv.c @@ -785,13 +785,15 @@ gchar *conv_iconv_strdup(const gchar *inbuf, outbuf_p = outbuf; out_left = out_size; - while ((n_conv = iconv(cd, (gchar **)&inbuf_p, &in_left, + while ((n_conv = iconv(cd, (ICONV_CONST gchar **)&inbuf_p, &in_left, &outbuf_p, &out_left)) < 0) { if (EILSEQ == errno) { - *outbuf_p = '\0'; + g_free(outbuf); + outbuf = NULL; break; } else if (EINVAL == errno) { - *outbuf_p = '\0'; + g_free(outbuf); + outbuf = NULL; break; } else if (E2BIG == errno) { out_size *= 2; @@ -808,6 +810,11 @@ gchar *conv_iconv_strdup(const gchar *inbuf, } } + if (outbuf) { + iconv(cd, NULL, NULL, &outbuf_p, &out_left); + outbuf = g_realloc(outbuf, strlen(outbuf) + 1); + } + iconv_close(cd); return outbuf; diff --git a/src/imap.c b/src/imap.c index 3def90782..92c09e8bd 100644 --- a/src/imap.c +++ b/src/imap.c @@ -3202,8 +3202,9 @@ static gchar *imap_modified_utf7_to_locale(const gchar *mutf7_str) to_len = strlen(mutf7_str) * 5; to_p = to_str = g_malloc(to_len + 1); - if (iconv(cd, &norm_utf7_p, &norm_utf7_len, &to_p, &to_len) == -1) { - g_warning("iconv cannot convert UTF-7 to %s\n", + if (iconv(cd, (ICONV_CONST gchar **)&norm_utf7_p, &norm_utf7_len, + &to_p, &to_len) == -1) { + g_warning(_("iconv cannot convert UTF-7 to %s\n"), conv_get_current_charset_str()); g_string_free(norm_utf7, TRUE); g_free(to_str); @@ -3268,7 +3269,7 @@ static gchar *imap_locale_to_modified_utf7(const gchar *from) mblen++) ; from_len -= mblen; - if (iconv(cd, &from_tmp, &mblen, + if (iconv(cd, (ICONV_CONST gchar **)&from_tmp, &mblen, &norm_utf7_p, &norm_utf7_len) == -1) { g_warning("iconv cannot convert %s to UTF-7\n", conv_get_current_charset_str());