Upgrade to Encode 1.92.
[p5sagit/p5-mst-13.2.git] / perl.c
diff --git a/perl.c b/perl.c
index 70cd770..b5ed17a 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.
@@ -65,6 +65,7 @@ static I32 read_e_script(pTHX_ int idx, SV *buf_sv, int maxlen);
            ALLOC_THREAD_KEY;                   \
            PERL_SET_THX(my_perl);              \
            OP_REFCNT_INIT;                     \
+           MUTEX_INIT(&PL_dollarzero_mutex);   \
        }                                       \
        else {                                  \
            PERL_SET_THX(my_perl);              \
@@ -155,9 +156,6 @@ perl_construct(pTHXx)
 
    /* Init the real globals (and main thread)? */
     if (!PL_linestr) {
-#ifdef USE_ITHREADS
-       MUTEX_INIT(&PL_dollarzero_mutex);       /* for $0 modifying */
-#endif
 #ifdef PERL_FLEXIBLE_EXCEPTIONS
        PL_protect = MEMBER_TO_FPTR(Perl_default_protect); /* for exceptions */
 #endif
@@ -386,6 +384,9 @@ perl_destruct(pTHXx)
 
     Safefree(PL_exitlist);
 
+    PL_exitlist = NULL;
+    PL_exitlistlen = 0;
+
     if (destruct_level == 0){
 
        DEBUG_P(debprofdump());
@@ -996,10 +997,6 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
       reswitch:
        switch (*s) {
        case 'C':
-#ifdef WIN32
-           win32_argv2utf8(argc-1, argv+1);
-           /* FALL THROUGH */
-#endif
 #ifndef PERL_STRICT_CR
        case '\r':
 #endif
@@ -2083,7 +2080,7 @@ Perl_eval_pv(pTHX_ const char *p, I32 croak_on_error)
 
 Tells Perl to C<require> the file named by the string argument.  It is
 analogous to the Perl code C<eval "require '$file'">.  It's even
-implemented that way; consider using Perl_load_module instead.
+implemented that way; consider using load_module instead.
 
 =cut */
 
@@ -2332,17 +2329,17 @@ Perl_moreswitches(pTHX_ char *s)
        return s;
     case 'A':
        forbid_setid("-A");
+       if (!PL_preambleav)
+           PL_preambleav = newAV();
        if (*++s) {
-           SV *sv=newSVpv("use assertions::activate split(/,/,q{",0);
+           SV *sv = newSVpvn("use assertions::activate split(/,/,q{",37);
            sv_catpv(sv,s);
            sv_catpv(sv,"})");
            s+=strlen(s);
-           if(!PL_preambleav)
-               PL_preambleav = newAV();
            av_push(PL_preambleav, sv);
        }
        else
-           Perl_croak(aTHX_ "No space allowed after -A");
+           av_push(PL_preambleav, newSVpvn("use assertions::activate",24));
        return s;
     case 'M':
        forbid_setid("-M");     /* XXX ? */
@@ -2444,7 +2441,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"
@@ -2501,8 +2498,8 @@ Perl_moreswitches(pTHX_ char *s)
                      "EPOC port by Olaf Flebbe, 1999-2002\n");
 #endif
 #ifdef UNDER_CE
-       printf("WINCE port by Rainer Keuchel, 2001-2002\n");
-       printf("Built on " __DATE__ " " __TIME__ "\n\n");
+       PerlIO_printf(PerlIO_stdout(),"WINCE port by Rainer Keuchel, 2001-2002\n");
+       PerlIO_printf(PerlIO_stdout(),"Built on " __DATE__ " " __TIME__ "\n\n");
        wce_hitreturn();
 #endif
 #ifdef BINARY_BUILD_NOTICE