summaryrefslogtreecommitdiff
path: root/ext/nkf
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
parent94df732f8b69356626130e0ec8b2dbc9340082ef (diff)
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')
-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 b59688c..58daad1 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++;\