diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-10-18 09:03:16 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-10-18 09:03:16 +0000 |
commit | 6eded0bb87a431f53f66aab0b306427b051f83c7 (patch) | |
tree | 2b9ac558373e9742e475be19fed72bfb7924a0f9 /ext/nkf/nkf.c | |
parent | a7da40cf41a584e8cf09100bacfd3c37d46178a6 (diff) | |
download | ruby-6eded0bb87a431f53f66aab0b306427b051f83c7.tar.gz ruby-6eded0bb87a431f53f66aab0b306427b051f83c7.tar.xz ruby-6eded0bb87a431f53f66aab0b306427b051f83c7.zip |
19991018
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf/nkf.c')
-rw-r--r-- | ext/nkf/nkf.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/ext/nkf/nkf.c b/ext/nkf/nkf.c index 80d0d2e4b..cde0f7a9a 100644 --- a/ext/nkf/nkf.c +++ b/ext/nkf/nkf.c @@ -31,14 +31,12 @@ rb_nkf_putchar(c) { if (output_ctr >= o_len) { o_len += incsize; - rb_str_cat(dst, "", incsize); + rb_str_cat(dst, 0, incsize); + output = RSTRING(dst)->ptr; incsize *= 2; } - output[output_ctr++] = c; -/* -printf("[[%c][%c][%d]]\n", c, output[output_ctr - 1], output_ctr); -*/ + return c; } @@ -78,18 +76,8 @@ rb_nkf_kconv(obj, opt, src) } kanji_convert(NULL); - if (output_ctr > 0) output_ctr--; - if (output[output_ctr] == '\0') { -/* -printf("([%c][%d])\n", output[output_ctr], output_ctr); -*/ - RSTRING(dst)->len = output_ctr; - } else { -/* -printf("<[%c][%d]>\n", output[output_ctr], output_ctr); -*/ - RSTRING(dst)->len = output_ctr + 1; - } + RSTRING(dst)->ptr[output_ctr] = '\0'; + RSTRING(dst)->len = output_ctr; return dst; } |