static VALUE
strio_gets(int argc, VALUE *argv, VALUE self)
{
struct getline_arg arg;
VALUE str;
if (prepare_getline_args(&arg, argc, argv)->limit == 0) {
struct StringIO *ptr = readable(self);
return rb_enc_str_new(0, 0, get_enc(ptr));
}
str = strio_getline(&arg, readable(self));
rb_lastline_set(str);
return str;
}