From: Ian Macdonald Date: 2003-11-13T19:54:48+09:00 Subject: Re: problems with rb_str_split() On Thu 13 Nov 2003 at 19:39:20 +0900, ts wrote: > >>>>> "I" == Ian Macdonald writes: > > I> So, it was just a bug in 1.8.0? Unfortunately, that's still the latest > I> official version, so I'm stuck with the issue at work for the time > I> being. > > svg% diff -u aa.c~ aa.c > --- aa.c~ 2003-11-13 11:34:19.000000000 +0100 > +++ aa.c 2003-11-13 11:37:33.000000000 +0100 > @@ -2,11 +2,14 @@ > > void Init_aa() > { > - VALUE res; > + VALUE res, rv; > const char *comma_sp = ", "; > int i; > > + rv = ruby_verbose; > + ruby_verbose = Qnil; > res = rb_str_split(rb_str_new2("abc, def"), ", "); > + ruby_verbose = rv; > for (i = 0; i < RARRAY(res)->len; i++) { > rb_warn("found %s", StringValuePtr(RARRAY(res)->ptr[i])); > } That's a nice way around the problem. Thanks! Ian -- Ian Macdonald | Actually, what I'd like is a little toy System Administrator | spaceship!! ian@caliban.org | http://www.caliban.org | |