This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use same mixture of hard-tabs and spaces for indent
[perl5.git] / perl.c
diff --git a/perl.c b/perl.c
index 2914d39..240484b 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -1166,14 +1166,8 @@ perl_destruct(pTHXx)
     }
 
     /* clear character classes  */
-    SvREFCNT_dec(PL_utf8_mark);
-    SvREFCNT_dec(PL_InBitmap);
 #ifdef USE_LOCALE_CTYPE
     SvREFCNT_dec(PL_warn_locale);
-#endif
-    PL_utf8_mark       = NULL;
-    PL_InBitmap          = NULL;
-#ifdef USE_LOCALE_CTYPE
     PL_warn_locale       = NULL;
 #endif
 
@@ -1336,8 +1330,8 @@ perl_destruct(pTHXx)
            for (sv = sva + 1; sv < svend; ++sv) {
                if (SvTYPE(sv) != (svtype)SVTYPEMASK) {
                    PerlIO_printf(Perl_debug_log, "leaked: sv=0x%p"
-                       " flags=0x%"UVxf
-                       " refcnt=%"UVuf pTHX__FORMAT "\n"
+                       " flags=0x%" UVxf
+                       " refcnt=%" UVuf pTHX__FORMAT "\n"
                        "\tallocated at %s:%d %s %s (parent 0x%" UVxf ");"
                        "serial %" UVuf "\n",
                        (void*)sv, (UV)sv->sv_flags, (UV)sv->sv_refcnt
@@ -1951,7 +1945,7 @@ S_Internals_V(pTHX_ CV *cv)
                             " PERL_USE_SAFE_PUTENV"
 #  endif
 #  ifdef SILENT_NO_TAINT_SUPPORT
-                             " SILENT_NO_TAINT_SUPPORT"
+                            " SILENT_NO_TAINT_SUPPORT"
 #  endif
 #  ifdef UNLINK_ALL_VERSIONS
                             " UNLINK_ALL_VERSIONS"
@@ -1977,6 +1971,9 @@ S_Internals_V(pTHX_ CV *cv)
 #  ifdef USE_SITECUSTOMIZE
                             " USE_SITECUSTOMIZE"
 #  endif              
+#  ifdef USE_THREAD_SAFE_LOCALE
+                            " USE_THREAD_SAFE_LOCALE"
+#  endif
        ;
     PERL_UNUSED_ARG(cv);
     PERL_UNUSED_VAR(items);
@@ -2285,7 +2282,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
        This could possibly be wasteful if PERL_INTERNAL_RAND_SEED is invalid,
        but avoids duplicating the logic from perl_construct().
     */
-    if (PL_tainting &&
+    if (TAINT_get &&
         PerlProc_getuid() == PerlProc_geteuid() &&
         PerlProc_getgid() == PerlProc_getegid()) {
         Perl_drand48_init_r(&PL_internal_random_state, seed());
@@ -2594,7 +2591,7 @@ int
 perl_run(pTHXx)
 {
     I32 oldscope;
-    int ret = 0, exit_called = 0;
+    int ret = 0;
     dJMPENV;
 
     PERL_ARGS_ASSERT_PERL_RUN;
@@ -2615,10 +2612,8 @@ perl_run(pTHXx)
     case 0:                            /* normal completion */
  redo_body:
        run_body(oldscope);
-       goto handle_exit;
+       /* FALLTHROUGH */
     case 2:                            /* my_exit() */
-       exit_called = 1;
-    handle_exit:
        while (PL_scopestack_ix > oldscope)
            LEAVE;
        FREETMPS;
@@ -2632,12 +2627,7 @@ perl_run(pTHXx)
        if (PerlEnv_getenv("PERL_DEBUG_MSTATS"))
            dump_mstats("after execution:  ");
 #endif
-       if (exit_called) {
-           ret = STATUS_EXIT;
-           if (ret == 0) ret = 0x100;
-       } else {
-           ret = 0;
-       }
+       ret = STATUS_EXIT;
        break;
     case 3:
        if (PL_restartop) {
@@ -3358,7 +3348,7 @@ Perl_get_debug_opts(pTHX_ const char **s, bool givehelp)
        }
     }
     else if (isDIGIT(**s)) {
-        const char* e;
+        const char* e = *s + strlen(*s);
        if (grok_atoUV(*s, &uv, &e))
             *s = e;
        for (; isWORDCHAR(**s); (*s)++) ;
@@ -3953,6 +3943,7 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, bool *suidscript)
         UV uv;
        /* if find_script() returns, it returns a malloc()-ed value */
        scriptname = PL_origfilename = find_script(scriptname, dosearch, NULL, 1);
+        s = scriptname + strlen(scriptname);
 
        if (strBEGINs(scriptname, "/dev/fd/")
             && isDIGIT(scriptname[8])