don't run END blocks when running under -c switch (older,
Gurusamy Sarathy [Sat, 9 Oct 1999 18:48:31 +0000 (18:48 +0000)]
rarely useful behavior may still be obtained by putting
BEGIN { $^C = 0; exit; } at the end of the script)

p4raw-id: //depot/perl@4323

perl.c

diff --git a/perl.c b/perl.c
index d7d7a57..aca20cb 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -651,7 +651,7 @@ setuid perl scripts securely.\n");
            LEAVE;
        FREETMPS;
        PL_curstash = PL_defstash;
-       if (PL_endav)
+       if (PL_endav && !PL_minus_c)
            call_list(oldscope, PL_endav);
        return STATUS_NATIVE_EXPORT;
     case 3:
@@ -1023,7 +1023,7 @@ perl_run(pTHXx)
            LEAVE;
        FREETMPS;
        PL_curstash = PL_defstash;
-       if (PL_endav)
+       if (PL_endav && !PL_minus_c)
            call_list(oldscope, PL_endav);
 #ifdef MYMALLOC
        if (PerlEnv_getenv("PERL_DEBUG_MSTATS"))
@@ -3019,7 +3019,7 @@ Perl_call_list(pTHX_ I32 oldscope, AV *paramList)
                LEAVE;
            FREETMPS;
            PL_curstash = PL_defstash;
-           if (PL_endav)
+           if (PL_endav && !PL_minus_c)
                call_list(oldscope, PL_endav);
            PL_curcop = &PL_compiling;
            PL_curcop->cop_line = oldline;