OSDN Git Service

Fix don't break line in ASCII. [nkf-forum:48850]
authorNARUSE, Yui <naruse@users.sourceforge.jp>
Sun, 14 Mar 2010 16:56:29 +0000 (01:56 +0900)
committerNARUSE, Yui <naruse@users.sourceforge.jp>
Sun, 14 Mar 2010 16:56:29 +0000 (01:56 +0900)
nkf.c
nkf_test.pl

diff --git a/nkf.c b/nkf.c
index 36bffb6..7944d62 100644 (file)
--- a/nkf.c
+++ b/nkf.c
@@ -21,7 +21,7 @@
  * 3. This notice may not be removed or altered from any source distribution.
  */
 #define NKF_VERSION "2.1.1"
-#define NKF_RELEASE_DATE "2010-01-29"
+#define NKF_RELEASE_DATE "2010-03-15"
 #define COPY_RIGHT \
     "Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \
     "Copyright (C) 1996-2010, The nkf Project."
@@ -4693,8 +4693,7 @@ mime_prechar(nkf_char c2, nkf_char c1)
                base64_count = 1;
            }
        } else {
-           if (!(c2 == 0 && (c1 == CR || c1 == LF)) &&
-                   base64_count + mimeout_state.count/3*4> 66) {
+           if ((c2 != 0 || c1 > DEL) && base64_count + mimeout_state.count/3*4> 66) {
                (*o_base64conv)(EOF,0);
                oconv_newline(o_base64conv);
                (*o_base64conv)(0,SP);
index 94e4ba5..73a360f 100644 (file)
@@ -1034,6 +1034,13 @@ printf "%-40s",  "[nkf-forum:47334]    ";
 printf "%-40s",  "[nkf-bug:20079]    ";
     &test("$nkf -jSxM","\xBB \xBB","=?ISO-2022-JP?B?GyhJOxsoQiAbKEk7GyhC?=");
 
+printf "%-40s",  "[nkf-forum:48850]    ";
+    &test("$nkf -jSM",
+       "From: \x82\xA0\x82\xA0\x82\xA0\x82\xA0\x82\xA0\x82\xA0\x82\xA0\x82\xA0\x82\xA0" .
+       " <x-xxxx@xxxxxxxxxxxx.co.jp>\n",
+       "From: =?ISO-2022-JP?B?GyRCJCIkIiQiJCIkIiQiJCIkIiQiGyhC?=" .
+       " <x-xxxx@xxxxxxxxxxxx.co.jp>\n");
+
     if (!NKF) {
 printf "%-40s", "Guess NL";
 &command_tests(