Patch from Peter Prymmer to disable utf8 in EBCDIC platforms.
[p5sagit/p5-mst-13.2.git] / perl.c
diff --git a/perl.c b/perl.c
index 89e6429..e5d263a 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -377,6 +377,7 @@ perl_destruct(pTHXx)
     DEBUG_S(PerlIO_printf(Perl_debug_log, "perl_destruct: armageddon has arrived\n"));
     MUTEX_DESTROY(&PL_threads_mutex);
     COND_DESTROY(&PL_nthreads_cond);
+    PL_nthreads--;
 #endif /* !defined(FAKE_THREADS) */
 #endif /* USE_THREADS */
 
@@ -722,7 +723,11 @@ perl_destruct(pTHXx)
     Safefree(PL_psig_ptr);
     Safefree(PL_psig_name);
     nuke_stacks();
+#ifdef EBCDIC
+    PL_hints = HINT_BYTE;      /* Reset hints. Should hints be per-interpreter ? */
+#else
     PL_hints = 0;              /* Reset hints. Should hints be per-interpreter ? */
+#endif
     
     DEBUG_P(debprofdump());
 #ifdef USE_THREADS
@@ -835,7 +840,7 @@ setuid perl scripts securely.\n");
 
     PL_origargv = argv;
     PL_origargc = argc;
-#ifndef VMS  /* VMS doesn't have environ array */
+#if !defined( VMS) && !defined(EPOC)  /* VMS doesn't have environ array */
     PL_origenviron = environ;
 #endif
 
@@ -1255,13 +1260,17 @@ print \"  \\@INC:\\n    @INC\\n\";");
     if (xsinit)
        (*xsinit)(aTHXo);       /* in case linked C routines want magical variables */
 #ifndef PERL_MICRO
-#if defined(VMS) || defined(WIN32) || defined(DJGPP) || defined(__CYGWIN__)
+#if defined(VMS) || defined(WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(EPOC)
     init_os_extras();
 #endif
 #endif
 
 #ifdef USE_SOCKS
+#   ifdef HAS_SOCKS5_INIT
+    socks5_init(argv[0]);
+#   else
     SOCKSinit(argv[0]);
+#   endif
 #endif    
 
     init_predump_symbols();
@@ -2244,7 +2253,7 @@ Perl_moreswitches(pTHX_ char *s)
        return s;
     case 'v':
        PerlIO_printf(PerlIO_stdout(),
-                     Perl_form(aTHX_ "\nThis is perl, v%vd built for %s",
+                     Perl_form(aTHX_ "\nThis is perl, v%"VDf" built for %s",
                                PL_patchlevel, ARCHNAME));
 #if defined(LOCAL_PATCH_COUNT)
        if (LOCAL_PATCH_COUNT > 0)
@@ -2317,7 +2326,7 @@ Perl_moreswitches(pTHX_ char *s)
        PerlIO_printf(PerlIO_stdout(),
                      "\n\
 Perl may be copied only under the terms of either the Artistic License or the\n\
-GNU General Public License, which may be found in the Perl 5.0 source kit.\n\n\
+GNU General Public License, which may be found in the Perl 5 source kit.\n\n\
 Complete documentation for Perl, including FAQ lists, should be found on\n\
 this system using `man perl' or `perldoc perl'.  If you have access to the\n\
 Internet, point your browser at http://www.perl.com/, the Perl Home Page.\n\n");
@@ -2501,12 +2510,20 @@ S_init_main_stash(pTHX)
     HvNAME(PL_defstash) = savepv("main");
     PL_incgv = gv_HVadd(gv_AVadd(gv_fetchpv("INC",TRUE, SVt_PVAV)));
     GvMULTI_on(PL_incgv);
+#ifdef EBCDIC
+    PL_hintgv = gv_fetchpv("\010",TRUE, SVt_PV); /* ^H */
+#else
     PL_hintgv = gv_fetchpv("\010",TRUE, SVt_PV); /* ^H */
+#endif
     GvMULTI_on(PL_hintgv);
     PL_defgv = gv_fetchpv("_",TRUE, SVt_PVAV);
     PL_errgv = gv_HVadd(gv_fetchpv("@", TRUE, SVt_PV));
     GvMULTI_on(PL_errgv);
+#ifdef EBCDIC
+    PL_replgv = gv_fetchpv("\022", TRUE, SVt_PV); /* ^R */
+#else
     PL_replgv = gv_fetchpv("\022", TRUE, SVt_PV); /* ^R */
+#endif
     GvMULTI_on(PL_replgv);
     (void)Perl_form(aTHX_ "%240s",""); /* Preallocate temp - for immediate signals. */
     sv_grow(ERRSV, 240);       /* Preallocate - for immediate signals. */
@@ -3463,7 +3480,7 @@ S_init_perllib(pTHX)
 #endif /* MACOS_TRADITIONAL */
 }
 
-#if defined(DOSISH)
+#if defined(DOSISH) || defined(EPOC)
 #    define PERLLIB_SEP ';'
 #else
 #  if defined(VMS)