summaryrefslogtreecommitdiff
path: root/ext/nkf/nkf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-06 15:06:00 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-06 15:06:00 +0000
commit1d3d27b42d1371ba6242ec217ca803f107ceb9eb (patch)
tree8d7e184fd63610124717df8dec31e719901965ad /ext/nkf/nkf.c
parent94df732f8b69356626130e0ec8b2dbc9340082ef (diff)
downloadruby-1d3d27b42d1371ba6242ec217ca803f107ceb9eb.tar.gz
forgot some checkins.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf/nkf.c')
-rw-r--r--ext/nkf/nkf.c18
1 files changed, 9 insertions, 9 deletions
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++;\