sync with 0.8.9cvs4
authorPaul Mangan <paul@claws-mail.org>
Fri, 31 Jan 2003 14:37:59 +0000 (14:37 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 31 Jan 2003 14:37:59 +0000 (14:37 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.ac
src/codeconv.c
src/imap.c

index 4f70cab..b664c79 100644 (file)
--- 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
index 0401d9c..7f2f74f 100644 (file)
@@ -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
index 3b59858..eee8c2b 100644 (file)
@@ -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(): ¸½ºßÁªÂò¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤¬
index 32d149f..aa26ecc 100644 (file)
@@ -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
index d12e566..f6b3d41 100644 (file)
@@ -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;
index 3def907..92c09e8 100644 (file)
@@ -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());