This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
IV changes for long long (was Re: 5.004_68 on its way to the CPAN)
[perl5.git] / perl.c
diff --git a/perl.c b/perl.c
index 084a1c3..db78b4e 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -1780,7 +1780,7 @@ STATIC void
 init_interp(void)
 {
 
-#if 0
+#ifdef PERL_OBJECT             /* XXX kludge */
 #define I_REINIT \
   STMT_START {                 \
     chopset    = " \n-";       \
@@ -1812,19 +1812,33 @@ init_interp(void)
     rsfp       = Nullfp;       \
     rsfp_filters= Nullav;      \
   } STMT_END
+    I_REINIT;
+#else
+#  ifdef MULTIPLICITY
+#    define PERLVAR(var,type)
+#    define PERLVARI(var,type,init)    curinterp->var = init;
+#    define PERLVARIC(var,type,init)   curinterp->var = init;
+#    include "intrpvar.h"
+#    ifndef USE_THREADS
+#      include "thrdvar.h"
+#    endif
+#    undef PERLVAR
+#    undef PERLVARI
+#    undef PERLVARIC
+#    else
+#    define PERLVAR(var,type)
+#    define PERLVARI(var,type,init)    var = init;
+#    define PERLVARIC(var,type,init)   var = init;
+#    include "intrpvar.h"
+#    ifndef USE_THREADS
+#      include "thrdvar.h"
+#    endif
+#    undef PERLVAR
+#    undef PERLVARI
+#    undef PERLVARIC
+#  endif
 #endif
 
-#define PERLVAR(var,type)
-#define PERLVARI(var,type,init)                curinterp->var = init;
-#define PERLVARIC(var,type,init)       curinterp->var = init;
-#include "intrpvar.h"
-#ifndef USE_THREADS
-#  include "thrdvar.h"
-#endif
-#undef PERLVAR
-#undef PERLVARI
-#undef PERLVARIC
-
 }
 
 STATIC void
@@ -1853,7 +1867,7 @@ init_main_stash(void)
     defgv = gv_fetchpv("_",TRUE, SVt_PVAV);
     errgv = gv_HVadd(gv_fetchpv("@", TRUE, SVt_PV));
     GvMULTI_on(errgv);
-    replgv = gv_HVadd(gv_fetchpv("\022", TRUE, SVt_PV)); /* ^R */
+    replgv = gv_fetchpv("\022", TRUE, SVt_PV); /* ^R */
     GvMULTI_on(replgv);
     (void)form("%240s","");    /* Preallocate temp - for immediate signals. */
     sv_grow(ERRSV, 240);       /* Preallocate - for immediate signals. */
@@ -1872,7 +1886,8 @@ open_script(char *scriptname, bool dosearch, SV *sv, int *fdscript)
     dTHR;
     register char *s;
 
-    scriptname = find_script(scriptname, dosearch, NULL, 0);
+    /* scriptname will be non-NULL if find_script() returns */
+    scriptname = find_script(scriptname, dosearch, NULL, 1);
 
     if (strnEQ(scriptname, "/dev/fd/", 8) && isDIGIT(scriptname[8]) ) {
        char *s = scriptname + 8;
@@ -1884,7 +1899,7 @@ open_script(char *scriptname, bool dosearch, SV *sv, int *fdscript)
     }
     else
        *fdscript = -1;
-    origfilename = savepv(e_script ? "-e" : scriptname);
+    origfilename = (e_script ? savepv("-e") : scriptname);
     curcop->cop_filegv = gv_fetchfile(origfilename);
     if (strEQ(origfilename,"-"))
        scriptname = "";
@@ -1897,7 +1912,7 @@ open_script(char *scriptname, bool dosearch, SV *sv, int *fdscript)
     }
     else if (preprocess) {
        char *cpp_cfg = CPPSTDIN;
-       SV *cpp = NEWSV(0,0);
+       SV *cpp = newSVpv("",0);
        SV *cmd = NEWSV(0,0);
 
        if (strEQ(cpp_cfg, "cppstdin"))