From 1d3d27b42d1371ba6242ec217ca803f107ceb9eb Mon Sep 17 00:00:00 2001 From: matz Date: Sun, 6 May 2001 15:06:00 +0000 Subject: forgot some checkins. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/nkf/nkf.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'ext/nkf') diff --git a/ext/nkf/nkf.c b/ext/nkf/nkf.c index b59688cb03..58daad11ab 100644 --- a/ext/nkf/nkf.c +++ b/ext/nkf/nkf.c @@ -47,13 +47,13 @@ static VALUE rb_nkf_kconv(obj, opt, src) VALUE obj, opt, src; { - int i; char *opt_ptr, *opt_end; volatile VALUE v; reinit(); - opt_ptr = str2cstr(opt, &i); - opt_end = opt_ptr + i; + StringValue(opt); + opt_ptr = RSTRING(opt)->ptr; + opt_end = opt_ptr + RSTRING(opt)->len; for (; opt_ptr < opt_end; opt_ptr++) { if (*opt_ptr != '-') { continue; @@ -64,7 +64,9 @@ rb_nkf_kconv(obj, opt, src) incsize = INCSIZE; input_ctr = 0; - input = str2cstr(src, &i_len); + StringValue(src); + input = RSTRING(src)->ptr; + i_len = RSTRING(src)->len; dst = rb_str_new(0, i_len*3 + 10); v = dst; @@ -96,13 +98,11 @@ rb_nkf_guess(obj, src) { unsigned char *p; unsigned char *pend; - int plen; int sequence_counter = 0; - Check_Type(src, T_STRING); - - p = str2cstr(src, &plen); - pend = p + plen; + StringValue(src); + p = RSTRING(src)->ptr; + pend = p + RSTRING(src)->len; #define INCR do {\ p++;\ -- cgit v1.2.3