sync with 0.8.0cvs2
authorPaul Mangan <paul@claws-mail.org>
Tue, 23 Jul 2002 12:46:21 +0000 (12:46 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 23 Jul 2002 12:46:21 +0000 (12:46 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/codeconv.c

index c257c900715e9199cc9d31a6489c13894e86d33a..55e1b968e28598fb9561256f1e98b5a6f6e93f83 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-07-23
+
+       * src/codeconv.c: conv_encode_header(): fixed a problem in encoding
+         strings which include both multi-byte and us-ascii characters.
+
 2002-07-23
 
        * src/utils.c: remove_numbered_files(): don't try to unlink()
 2002-07-23
 
        * src/utils.c: remove_numbered_files(): don't try to unlink()
index 19d2d631bd87e09a4697e0594d0f015548db6eaa..11f5f81e59d7d333691a63593447d1c792a8adb7 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-23 [paul]      0.8.0claws2
+
+       * sync with 0.8.0cvs2
+               see ChangeLog 2002-07-23
+
 2002-07-23 [paul]      0.8.0claws1
 
        * sync with 0.8.0cvs1
 2002-07-23 [paul]      0.8.0claws1
 
        * sync with 0.8.0cvs1
index c75879c0c1e3b991227650dab39daabdf38b28e5..e35fd127ea6df8b606debc75d1cc1901db764109 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-23
+
+       * src/codeconv.c: conv_encode_header(): ¥Þ¥ë¥Á¥Ð¥¤¥È¤È us-ascii
+         Ê¸»ú¤òξÊý´Þ¤àʸ»úÎó¤Î¥¨¥ó¥³¡¼¥É¤ÎÌäÂê¤ò½¤Àµ¡£
+
 2002-07-23
 
        * src/utils.c: remove_numbered_files(): ¥Ç¥£¥ì¥¯¥È¥ê¤ò unlink()
 2002-07-23
 
        * src/utils.c: remove_numbered_files(): ¥Ç¥£¥ì¥¯¥È¥ê¤ò unlink()
index 47bb21a5856631a4e87105b07d553219bf32a235..b20b47108c3353d5c7c76a1d9aac57cfef30737c 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws1
+EXTRA_VERSION=claws2
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index b43d55a376eb9de65291d6adc18c277def5f26f0..c67a1286e9a0f2465c041f72ad034c9c4f5919e2 100644 (file)
@@ -1062,6 +1062,7 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
        while (*wsrcp) {
                wchar_t *wp, *wtmp, *wtmpp;
                gint nspc = 0;
        while (*wsrcp) {
                wchar_t *wp, *wtmp, *wtmpp;
                gint nspc = 0;
+               gboolean str_is_non_ascii;
 
                /* irresponsible buffer overrun check */
                if ((len - (destp - dest)) < (MAX_LINELEN + 1) * 2) break;
 
                /* irresponsible buffer overrun check */
                if ((len - (destp - dest)) < (MAX_LINELEN + 1) * 2) break;
@@ -1072,8 +1073,11 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
                        wp = wsrcp;
                        while ((wp = find_wspace(wp)) != NULL)
                                if (!is_next_nonascii(wp)) break;
                        wp = wsrcp;
                        while ((wp = find_wspace(wp)) != NULL)
                                if (!is_next_nonascii(wp)) break;
-               } else
+                       str_is_non_ascii = TRUE;
+               } else {
                        wp = find_wspace(wsrcp);
                        wp = find_wspace(wsrcp);
+                       str_is_non_ascii = FALSE;
+               }
 
                if (wp != NULL) {
                        wtmp = wcsndup(wsrcp, wp - wsrcp);
 
                if (wp != NULL) {
                        wtmp = wcsndup(wsrcp, wp - wsrcp);
@@ -1087,7 +1091,7 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
                wtmpp = wtmp;
 
                do {
                wtmpp = wtmp;
 
                do {
-                       gint tlen = 0, str_ascii = 1;
+                       gint tlen = 0;
                        gchar *tmp; /* internal codeset */
                        gchar *raw; /* converted, but not base64 encoded */
                        register gchar *tmpp;
                        gchar *tmp; /* internal codeset */
                        gchar *raw; /* converted, but not base64 encoded */
                        register gchar *tmpp;
@@ -1105,8 +1109,6 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
                                int raw_new_len = 0;
                                const gchar *src_codeset;
 
                                int raw_new_len = 0;
                                const gchar *src_codeset;
 
-                               if (*wtmpp < 32 || *wtmpp >= 127)
-                                       str_ascii = 0;
                                mbl = wctomb(tmpp, *wtmpp);
                                if (mbl == -1) {
                                        g_warning("invalid wide character\n");
                                mbl = wctomb(tmpp, *wtmpp);
                                if (mbl == -1) {
                                        g_warning("invalid wide character\n");
@@ -1127,7 +1129,7 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
                                        wtmpp++;
                                        continue;
                                }
                                        wtmpp++;
                                        continue;
                                }
-                               if (!str_ascii) {
+                               if (str_is_non_ascii) {
                                        gint dlen = mimehdr_len +
                                                B64LEN(raw_len);
                                        if ((line_len + dlen +
                                        gint dlen = mimehdr_len +
                                                B64LEN(raw_len);
                                        if ((line_len + dlen +
@@ -1139,7 +1141,6 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
                                                        *destp++ = '\n';
                                                        *destp++ = ' ';
                                                        line_len = 1;
                                                        *destp++ = '\n';
                                                        *destp++ = ' ';
                                                        line_len = 1;
-                                                       str_ascii = 1;
                                                        continue;
                                                } else {
                                                        *tmpp = '\0';
                                                        continue;
                                                } else {
                                                        *tmpp = '\0';
@@ -1189,7 +1190,7 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
                                line_len++;
                        }
 
                                line_len++;
                        }
 
-                       if (!str_ascii) {
+                       if (str_is_non_ascii) {
                                g_snprintf(destp, len - strlen(dest), "%s%s%s",
                                           mimehdr_init, mimehdr_charset,
                                           mimehdr_enctype);
                                g_snprintf(destp, len - strlen(dest), "%s%s%s",
                                           mimehdr_init, mimehdr_charset,
                                           mimehdr_enctype);