initialize_copy(p1)
public
Show source
/*
* call-seq:
* dup
* clone
*
* Duplicates a StringScanner object.
*/
static VALUE
strscan_init_copy(VALUE vself, VALUE vorig)
{
struct strscanner *self, *orig;
Data_Get_Struct(vself, struct strscanner, self);
check_strscan(vorig);
Data_Get_Struct(vorig, struct strscanner, orig);
if (self != orig) {
self->flags = orig->flags;
self->str = orig->str;
self->prev = orig->prev;
self->curr = orig->curr;
re_copy_registers(&self->regs, &orig->regs);
}
return vself;
}