Re: [perl #18872] File::Basename example misleading
[p5sagit/p5-mst-13.2.git] / perl.c
diff --git a/perl.c b/perl.c
index 866c9a8..869c666 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -1,6 +1,6 @@
 /*    perl.c
  *
- *    Copyright (c) 1987-2002 Larry Wall
+ *    Copyright (c) 1987-2003 Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -1357,14 +1357,15 @@ print \"  \\@INC:\\n    @INC\\n\";");
      * PL_utf8locale is conditionally turned on by
      * locale.c:Perl_init_i18nl10n() if the environment
      * look like the user wants to use UTF-8. */
-    if (PL_unicode) { /* Requires init_predump_symbols(). */
-        IO* io;
-        PerlIO* fp;
-        SV* sv;
-
+    if (PL_unicode) {
+        /* Requires init_predump_symbols(). */
         if (!(PL_unicode & PERL_UNICODE_LOCALE_FLAG) || PL_utf8locale) {
+             IO* io;
+             PerlIO* fp;
+             SV* sv;
+
              /* Turn on UTF-8-ness on STDIN, STDOUT, STDERR
-              * and the default open discipline. */
+              * and the default open disciplines. */
              if ((PL_unicode & PERL_UNICODE_STDIN_FLAG) &&
                  PL_stdingv  && (io = GvIO(PL_stdingv)) &&
                  (fp = IoIFP(io)))
@@ -1394,6 +1395,15 @@ print \"  \\@INC:\\n    @INC\\n\";");
         }
     }
 
+    if ((s = PerlEnv_getenv("PERL_SIGNALS"))) {
+        if (strEQ(s, "unsafe"))
+             PL_signals |=  PERL_SIGNALS_UNSAFE_FLAG;
+        else if (strEQ(s, "safe"))
+             PL_signals &= ~PERL_SIGNALS_UNSAFE_FLAG;
+        else
+             Perl_croak(aTHX_ "PERL_SIGNALS illegal: \"%s\"", s);
+    }
+
     init_lexer();
 
     /* now parse the script */
@@ -2434,7 +2444,7 @@ Perl_moreswitches(pTHX_ char *s)
 #endif
 
        PerlIO_printf(PerlIO_stdout(),
-                     "\n\nCopyright 1987-2002, Larry Wall\n");
+                     "\n\nCopyright 1987-2003, Larry Wall\n");
 #ifdef MACOS_TRADITIONAL
        PerlIO_printf(PerlIO_stdout(),
                      "\nMac OS port Copyright 1991-2002, Matthias Neeracher;\n"