From 8e70a60da0d3a34cf6c748d81a6fab42a5734e26 Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 27 Jun 2005 16:53:48 +0000 Subject: * ext/nkf/lib/kconv.rb: add Kconv::VERSION * ext/nkf/lib/kconv.rb (conv): can process arrayed options * ext/nkf/nkf-utf8/nkf.c: imported Revision 1.69 * ext/nkf/nkf-utf8/utf8tbl.c: imported Revision 1.9 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/nkf/nkf-utf8/nkf.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'ext/nkf/nkf-utf8/nkf.c') diff --git a/ext/nkf/nkf-utf8/nkf.c b/ext/nkf/nkf-utf8/nkf.c index 2973799fb2..9fd1436239 100644 --- a/ext/nkf/nkf-utf8/nkf.c +++ b/ext/nkf/nkf-utf8/nkf.c @@ -41,7 +41,7 @@ ***********************************************************************/ /* $Id$ */ #define NKF_VERSION "2.0.5" -#define NKF_RELEASE_DATE "2005-04-10" +#define NKF_RELEASE_DATE "2005-06-28" #include "config.h" static char *CopyRight = @@ -970,13 +970,9 @@ options(cp) if (option_mode==1) return; - if (*cp++ != '-') - return; + while(*cp && *cp++!='-'); while (*cp) { - if (p && !*cp) { - cp = p; - p = 0; - } + p = 0; switch (*cp++) { case '-': /* literal options */ if (!*cp) { /* ignore the rest of arguments */ @@ -986,8 +982,8 @@ options(cp) for (i=0;i kata - bit:2 kata -> hira + bit:1 katakana->hiragana + bit:2 hiragana->katakana */ if ('9'>= *cp && *cp>='0') hira_f |= (*cp++ -'0'); @@ -1320,8 +1317,7 @@ options(cp) continue; case ' ': /* module muliple options in a string are allowed for Perl moudle */ - while(*cp && *cp!='-') cp++; - if(*cp=='-') cp++; + while(*cp && *cp++!='-'); continue; default: /* bogus option but ignored */ @@ -4732,7 +4728,7 @@ usage() fprintf(stderr,"t no conversion\n"); fprintf(stderr,"i_/o_ Output sequence to designate JIS-kanji/ASCII (DEFAULT B)\n"); fprintf(stderr,"r {de/en}crypt ROT13/47\n"); - fprintf(stderr,"h 1 hirakana->katakana, 2 katakana->hirakana,3 both\n"); + fprintf(stderr,"h 1 katakana->hiragana, 2 hiragana->katakana, 3 both\n"); fprintf(stderr,"v Show this usage. V: show version\n"); fprintf(stderr,"m[BQN0] MIME decode [B:base64,Q:quoted,N:non-strict,0:no decode]\n"); fprintf(stderr,"M[BQ] MIME encode [B:base64 Q:quoted]\n"); @@ -4755,6 +4751,7 @@ usage() fprintf(stderr," --hiragana, --katakana Hiragana/Katakana Conversion\n"); fprintf(stderr," --x0212 Convert JISX0212\n"); fprintf(stderr," --cp932, --no-cp932 CP932 compatibility\n"); + fprintf(stderr," --prefix= Insert escape before troublesome characters of Shift_JIS\n"); #ifdef INPUT_OPTION fprintf(stderr," --cap-input, --url-input Convert hex after ':' or '%%'\n"); #endif -- cgit v1.2.3