This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
First class regexps.
[perl5.git] / util.c
diff --git a/util.c b/util.c
index 62fd7ba..fef0393 100644 (file)
--- a/util.c
+++ b/util.c
@@ -2343,7 +2343,7 @@ Perl_my_popen_list(pTHX_ char *mode, int n, SV **args)
     return PerlIO_fdopen(p[This], mode);
 #else
 #  ifdef OS2   /* Same, without fork()ing and all extra overhead... */
-    return my_syspopen4(aTHX_ Nullch, mode, n, args);
+    return my_syspopen4(aTHX_ NULL, mode, n, args);
 #  else
     Perl_croak(aTHX_ "List form of piped open not implemented");
     return (PerlIO *) NULL;
@@ -4176,10 +4176,6 @@ Perl_scan_version(pTHX_ const char *s, SV *rv, bool qv)
     SV * const hv = newSVrv(rv, "version"); /* create an SV and upgrade the RV */
     (void)sv_upgrade(hv, SVt_PVHV); /* needs to be an HV type */
 
-#ifndef NODEFAULT_SHAREKEYS
-    HvSHAREKEYS_on(hv);         /* key-sharing on by default */
-#endif
-
     while (isSPACE(*s)) /* leading whitespace is OK */
        s++;
 
@@ -4386,9 +4382,6 @@ Perl_new_version(pTHX_ SV *ver)
        /* This will get reblessed later if a derived class*/
        SV * const hv = newSVrv(rv, "version"); 
        (void)sv_upgrade(hv, SVt_PVHV); /* needs to be an HV type */
-#ifndef NODEFAULT_SHAREKEYS
-       HvSHAREKEYS_on(hv);         /* key-sharing on by default */
-#endif
 
        if ( SvROK(ver) )
            ver = SvRV(ver);
@@ -5921,17 +5914,15 @@ Perl_my_dirfd(pTHX_ DIR * dir) {
 REGEXP *
 Perl_get_re_arg(pTHX_ SV *sv) {
     SV    *tmpsv;
-    MAGIC *mg;
 
     if (sv) {
         if (SvMAGICAL(sv))
             mg_get(sv);
         if (SvROK(sv) &&
             (tmpsv = (SV*)SvRV(sv)) &&            /* assign deliberate */
-            SvTYPE(tmpsv) == SVt_PVMG &&
-            (mg = mg_find(tmpsv, PERL_MAGIC_qr))) /* assign deliberate */
+            SvTYPE(tmpsv) == SVt_REGEXP)
         {
-            return (REGEXP *)mg->mg_obj;
+            return ((struct xregexp *)SvANY(tmpsv))->xrx_regexp;
         }
     }