From: NARUSE, Yui Date: Tue, 2 May 2006 04:51:31 +0000 (+0000) Subject: * Add -t2 option which uses put_* functions. X-Git-Tag: v2_0_7~11 X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=bfee0c30eb5d0ce0c47f4d5c739f403434810f4c;hp=74c507190df2c7fdbff2f981d3f8c9f74c1b2823;p=nkf%2Fnkf.git * Add -t2 option which uses put_* functions. * Fix: MIME encode bug. [ruby-list:42053] --- diff --git a/nkf.c b/nkf.c index 4b0e4e0..94c1f64 100644 --- a/nkf.c +++ b/nkf.c @@ -39,9 +39,9 @@ ** E-Mail: furukawa@tcp-ip.or.jp ** まで御連絡をお願いします。 ***********************************************************************/ -/* $Id: nkf.c,v 1.97 2006/04/01 18:19:25 naruse Exp $ */ +/* $Id: nkf.c,v 1.98 2006/05/01 19:51:31 naruse Exp $ */ #define NKF_VERSION "2.0.7" -#define NKF_RELEASE_DATE "2006-04-01" +#define NKF_RELEASE_DATE "2006-04-22" #include "config.h" #define COPY_RIGHT \ @@ -1580,7 +1580,21 @@ void options(unsigned char *cp) unbuf_f = TRUE; continue; case 't': /* transparent mode */ - nop_f = TRUE; + if (*cp=='1') { + /* alias of -t */ + nop_f = TRUE; + *cp++; + } else if (*cp=='2') { + /* + * -t with put/get + * + * nkf -t2MB hoge.bin | nkf -t2mB | diff -s - hoge.bin + * + */ + nop_f = 2; + *cp++; + } else + nop_f = TRUE; continue; case 'j': /* JIS output */ case 'n': @@ -2229,8 +2243,11 @@ int noconvert(FILE *f) { int c; + if (nop_f == 2) + module_connection(); while ((c = (*i_getc)(f)) != EOF) (*o_putc)(c); + (*o_putc)(EOF); return 1; } #endif @@ -5081,16 +5098,21 @@ void mime_putc(int c) j = mimeout_buf_count; mimeout_buf_count = 0; i = 0; - for (;i # Sun Aug 18 12:25:40 JST 1996 @@ -825,6 +825,14 @@ eofeof printf "%-40s", "test_data/mime_out2"; &test("$nkf -jM",$example{'test_data/mime_out2'},$example{'test_data/mime_out2.ans'},$example{'test_data/mime_out2.ans.alt'},$example{'test_data/mime_out2.ans.alt2'}); +# test_data/mime_out + +$example{'test_data/mime_out3'} = "\x82\xD9\x82\xB0 A"; + +$example{'test_data/mime_out3.ans'} = "=?ISO-2022-JP?B?GyRCJFskMhsoQg==?= A"; + +printf "%-40s", "test_data/mime_out3"; + &test("$nkf -jSM",$example{'test_data/mime_out3'},$example{'test_data/mime_out3.ans'}); # test_data/multi-line $example{'test_data/multi-line'} = unpack('u',<<'eofeof');