[inseparable changes from patch from perl5.003_12 to perl5.003_13]
[p5sagit/p5-mst-13.2.git] / doio.c
diff --git a/doio.c b/doio.c
index c1de1e0..175b6b0 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -418,7 +418,7 @@ register GV *gv;
                    (void)unlink(SvPVX(sv));
                    (void)rename(oldname,SvPVX(sv));
                    do_open(gv,SvPVX(sv),SvCUR(sv),FALSE,0,0,Nullfp);
-#endif /* MSDOS */
+#endif /* DOSISH */
 #else
                    (void)UNLINK(SvPVX(sv));
                    if (link(oldname,SvPVX(sv)) < 0) {
@@ -431,7 +431,7 @@ register GV *gv;
 #endif
                }
                else {
-#ifndef DOSISH
+#if !defined(DOSISH) && !defined(AMIGAOS)
 #  ifndef VMS  /* Don't delete; use automatic file versioning */
                    if (UNLINK(oldname) < 0) {
                        warn("Can't rename %s to %s: %s, skipping file",
@@ -742,56 +742,6 @@ Off_t length;              /* length to set file to */
 }
 #endif /* F_FREESP */
 
-I32
-looks_like_number(sv)
-SV *sv;
-{
-    register char *s;
-    register char *send;
-
-    if (!SvPOK(sv)) {
-       STRLEN len;
-       if (!SvPOKp(sv))
-           return TRUE;
-       s = SvPV(sv, len);
-       send = s + len;
-    }
-    else {
-       s = SvPVX(sv); 
-       send = s + SvCUR(sv);
-    }
-    while (isSPACE(*s))
-       s++;
-    if (s >= send)
-       return FALSE;
-    if (*s == '+' || *s == '-')
-       s++;
-    while (isDIGIT(*s))
-       s++;
-    if (s == send)
-       return TRUE;
-    if (*s == '.') 
-       s++;
-    else if (s == SvPVX(sv))
-       return FALSE;
-    while (isDIGIT(*s))
-       s++;
-    if (s == send)
-       return TRUE;
-    if (*s == 'e' || *s == 'E') {
-       s++;
-       if (*s == '+' || *s == '-')
-           s++;
-       while (isDIGIT(*s))
-           s++;
-    }
-    while (isSPACE(*s))
-       s++;
-    if (s >= send)
-       return TRUE;
-    return FALSE;
-}
-
 bool
 do_print(sv,fp)
 register SV *sv;
@@ -1027,7 +977,7 @@ char *cmd;
                break;
            }
          doshell:
-           execl(SH_PATH, "sh", "-c", cmd, (char*)0);
+           execl(sh_path, "sh", "-c", cmd, (char*)0);
            return FALSE;
        }
     }
@@ -1057,7 +1007,7 @@ char *cmd;
     return FALSE;
 }
 
-#endif 
+#endif /* OS2 */
 
 I32
 apply(type,mark,sp)
@@ -1073,9 +1023,10 @@ register SV **sp;
 
     if (tainting) {
        while (++mark <= sp) {
-           MAGIC *mg;
-           if (SvMAGICAL(*mark) && (mg = mg_find(*mark, 't')) && mg->mg_len & 1)
-               tainted = TRUE;
+           if (SvTAINTED(*mark)) {
+               TAINT;
+               break;
+           }
        }
        mark = oldmark;
     }
@@ -1108,6 +1059,8 @@ register SV **sp;
 #ifdef HAS_KILL
     case OP_KILL:
        TAINT_PROPER("kill");
+       if (mark == sp)
+           break;
        s = SvPVx(*++mark, na);
        tot = sp - mark;
        if (isUPPER(*s)) {
@@ -1258,7 +1211,7 @@ register struct stat *statbufp;
       */
      return (bit & statbufp->st_mode) ? TRUE : FALSE;
 
-#else /* ! MSDOS */
+#else /* ! DOSISH */
     if ((effective ? euid : uid) == 0) {       /* root is special */
        if (bit == S_IXUSR) {
            if (statbufp->st_mode & 0111 || S_ISDIR(statbufp->st_mode))
@@ -1279,7 +1232,7 @@ register struct stat *statbufp;
     else if (statbufp->st_mode & bit >> 6)
        return TRUE;    /* ok as "other" */
     return FALSE;
-#endif /* ! MSDOS */
+#endif /* ! DOSISH */
 }
 #endif /* ! VMS */