#define get_op_descs Perl_get_op_descs
#define get_op_names Perl_get_op_names
#define get_opargs Perl_get_opargs
-#define get_specialsv_list Perl_get_specialsv_list
+#define get_specialsv_list Perl_get_specialsv_list
#define gp_free Perl_gp_free
#define gp_ref Perl_gp_ref
#define gt_amg Perl_gt_amg
#define magic_setuvar Perl_magic_setuvar
#define magic_setvec Perl_magic_setvec
#define magic_sizepack Perl_magic_sizepack
+#define magic_unchain Perl_magic_unchain
#define magic_wipepack Perl_magic_wipepack
#define magicname Perl_magicname
#define markstack_grow Perl_markstack_grow
#define sle_amg Perl_sle_amg
#define slt_amg Perl_slt_amg
#define sne_amg Perl_sne_amg
-#define specialsv_list Perl_specialsv_list
#define sqrt_amg Perl_sqrt_amg
#define stack_grow Perl_stack_grow
#define start_subparse Perl_start_subparse
#define sortcop (curinterp->Isortcop)
#define sortcxix (curinterp->Isortcxix)
#define sortstash (curinterp->Isortstash)
-#define specialsv_list (curinterp->Ispecialsv_list)
#define splitstr (curinterp->Isplitstr)
#define statcache (curinterp->Istatcache)
#define statgv (curinterp->Istatgv)
#define Isortcop sortcop
#define Isortcxix sortcxix
#define Isortstash sortstash
-#define Ispecialsv_list specialsv_list
#define Isplitstr splitstr
#define Istatcache statcache
#define Istatgv statgv
#define sortcop Perl_sortcop
#define sortcxix Perl_sortcxix
#define sortstash Perl_sortstash
-#define specialsv_list Perl_specialsv_list
#define splitstr Perl_splitstr
#define statcache Perl_statcache
#define statgv Perl_statgv
#define scrgv (Perl_Vars.Gscrgv)
#define sh_path (Perl_Vars.Gsh_path)
#define sighandlerp (Perl_Vars.Gsighandlerp)
+#define specialsv_list (Perl_Vars.Gspecialsv_list)
#define sub_generation (Perl_Vars.Gsub_generation)
#define subline (Perl_Vars.Gsubline)
#define subname (Perl_Vars.Gsubname)
#define Gscrgv scrgv
#define Gsh_path sh_path
#define Gsighandlerp sighandlerp
+#define Gspecialsv_list specialsv_list
#define Gsub_generation sub_generation
#define Gsubline subline
#define Gsubname subname
#define scrgv Perl_scrgv
#define sh_path Perl_sh_path
#define sighandlerp Perl_sighandlerp
+#define specialsv_list Perl_specialsv_list
#define sub_generation Perl_sub_generation
#define subline Perl_subline
#define subname Perl_subname
fold_locale
freq
ge_amg
-get_op_descs
-get_op_names
-get_no_modify
-get_opargs
gt_amg
inc_amg
init_thread_intern
sle_amg
slt_amg
sne_amg
-specialsv_list
sqrt_amg
string_amg
subtr_amg
form
free_tmps
gen_constant_list
+get_op_descs
+get_op_names
+get_no_modify
+get_opargs
+get_specialsv_list
gp_free
gp_ref
gv_AVadd
magic_setuvar
magic_setvec
magic_sizepack
+magic_unchain
magic_wipepack
magicname
markstack_grow
PERLVARI(piSock, IPerlSock*, NULL)
PERLVARI(piProc, IPerlProc*, NULL)
#endif
-
-PERLVAR(Ispecialsv_list[4], SV *) /* from byterun.h */
return 0;
}
+int
+magic_unchain(SV *sv, MAGIC *mg)
+{
+ sv_unmagic(sv, mg->mg_type);
+ return 0;
+}
+
#ifdef USE_LOCALE_COLLATE
int
magic_setcollxfrm(SV *sv, MAGIC *mg)
EXT MGVTBL vtbl_defelem = {magic_getdefelem,magic_setdefelem,
0, 0, magic_freedefelem};
-EXT MGVTBL vtbl_regexp = {0,0,0,0, magic_freeregexp};
+EXT MGVTBL vtbl_regexp = {0,magic_unchain,0,0, magic_freeregexp};
#ifdef USE_LOCALE_COLLATE
EXT MGVTBL vtbl_collxfrm = {0,
PERLVARIC(Ghexdigit, char *, "0123456789abcdef0123456789ABCDEFx")
PERLVARIC(Gpatleave, char *, "\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}")
+PERLVAR(Gspecialsv_list[4], SV *) /* from byterun.h */
+
MAGIC *mg = Null(MAGIC*);
tmpstr = POPs;
- if(SvROK(tmpstr)) {
- SV *sv = SvRV(tmpstr);
+ if(SvROK(tmpstr) || SvRMAGICAL(tmpstr)) {
+ SV *sv = SvROK(tmpstr) ? SvRV(tmpstr) : tmpstr;
if(SvMAGICAL(sv))
mg = mg_find(sv, 'r');
}
pm->op_pmflags = pm->op_pmpermflags; /* reset case sensitivity */
pm->op_pmregexp = pregcomp(t, t + len, pm);
+ sv_magic(tmpstr,(SV*)ReREFCNT_inc(pm->op_pmregexp),'r',0,0);
}
}
VIRTUAL int magic_setvec _((SV* sv, MAGIC* mg));
VIRTUAL int magic_set_all_env _((SV* sv, MAGIC* mg));
VIRTUAL U32 magic_sizepack _((SV* sv, MAGIC* mg));
+VIRTUAL int magic_unchain _((SV* sv, MAGIC* mg));
VIRTUAL int magic_wipepack _((SV* sv, MAGIC* mg));
VIRTUAL void magicname _((char* sym, char* name, I32 namlen));
int main _((int argc, char** argv, char** env));
mg->mg_virtual = &vtbl_packelem;
break;
case 'r':
+ SvRMAGICAL_on(sv);
mg->mg_virtual = &vtbl_regexp;
break;
case 'S':