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 4f70cab6b4d325559ba6a9f8802732146c0a0ec3..b664c79f3150464e6af792673b6bdcc1becd2642 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 0401d9c2b6064ef703cd06a0347c81276c1be75d..7f2f74f4c44529d6975914828365d6472a2b1cbb 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 3b598584a10a28ea8830df8b1b791090bf7b551b..eee8c2b54ac753b71734776830e4db2ca59cfd13 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 32d149f753d41a077509962eca91deefa937af6d..aa26ecc72b721d8f23e2f9a8ce5e02e296e3ca3a 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 d12e5660878d97bce2ce62a500e7e75b000fb305..f6b3d41850c1b78e27d4509f54768bc8164a6da8 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 3def90782ab87ba13c46dbcd355f5e01ad0fa5d6..92c09e8bdd9167a1292f74c8e0f52660e997e87c 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());