/*
* ???
*/
static VALUE
rb_gzfile_set_orig_name(obj, str)
VALUE obj, str;
{
struct gzfile *gz = get_gzfile(obj);
VALUE s;
char *p;
if (gz->z.flags & GZFILE_FLAG_HEADER_FINISHED) {
rb_raise(cGzError, "header is already written");
}
s = rb_str_dup(rb_str_to_str(str));
p = memchr(RSTRING(s)->ptr, '\0', RSTRING(s)->len);
if (p) {
rb_str_resize(s, p - RSTRING(s)->ptr);
}
gz->orig_name = s;
return str;
}