$\1 and serious bug in evalling
[p5sagit/p5-mst-13.2.git] / perl.c
diff --git a/perl.c b/perl.c
index 8af7172..f757d11 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -1017,6 +1017,7 @@ I32 flags;                /* See G_* flags in cop.h */
     bool oldcatch = CATCH_GET;
     dJMPENV;
     int ret;
+    OP* oldop = op;
 
     if (flags & G_DISCARD) {
        ENTER;
@@ -1139,6 +1140,7 @@ I32 flags;                /* See G_* flags in cop.h */
        FREETMPS;
        LEAVE;
     }
+    op = oldop;
     return retval;
 }
 
@@ -1654,7 +1656,11 @@ SV *sv;
                continue;       /* don't search dir with too-long name */
            strcat(tokenbuf, scriptname);
 #else  /* !VMS */
-    if (dosearch && !strchr(scriptname, '/') && (s = getenv("PATH"))) {
+    if (dosearch && !strchr(scriptname, '/')
+#ifdef DOSISH
+                && !strchr(scriptname, '\\')
+#endif
+                && (s = getenv("PATH"))) {
        bufend = s + strlen(s);
        while (s < bufend) {
 #ifndef atarist
@@ -1706,7 +1712,12 @@ SV *sv;
            if (retval < 0)
                continue;
            if (S_ISREG(statbuf.st_mode)
-            && cando(S_IRUSR,TRUE,&statbuf) && cando(S_IXUSR,TRUE,&statbuf)) {
+               && cando(S_IRUSR,TRUE,&statbuf)
+#ifndef DOSISH
+               && cando(S_IXUSR,TRUE,&statbuf)
+#endif
+               )
+           {
                xfound = tokenbuf;              /* bingo! */
                break;
            }
@@ -2351,6 +2362,10 @@ register char **env;
            sv = newSVpv(s--,0);
            (void)hv_store(hv, *env, s - *env, sv, 0);
            *s = '=';
+#if defined(__BORLANDC__) && defined(USE_WIN32_RTL_ENV)
+           /* Sins of the RTL. See note in my_setenv(). */
+           (void)putenv(savepv(*env));
+#endif
        }
 #endif
 #ifdef DYNAMIC_ENV_FETCH
@@ -2387,7 +2402,7 @@ init_perllib()
 #endif /* VMS */
     }
 
-/* Use the ~-expanded versions of APPLIB (undocumented),
+/* Use the ~-expanded versions of APPLLIB (undocumented),
     ARCHLIB PRIVLIB SITEARCH SITELIB and OLDARCHLIB
 */
 #ifdef APPLLIB_EXP