djgpp update (from Laszlo Molnar)
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index 9e3ad52..3429c45 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -359,6 +359,9 @@ PP(pp_glob)
     ENTER;
 
 #ifndef VMS
+    /* If we're not using an external glob, just let readdir() tainting
+     * do its thing.  Otherwise, engage paranoia mode. */
+#if defined(PERL_EXTERNAL_GLOB)
     if (PL_tainting) {
        /*
         * The external globbing program may use things we can't control,
@@ -367,6 +370,7 @@ PP(pp_glob)
        TAINT;
        taint_proper(PL_no_security, "glob");
     }
+#endif /* PERL_EXTERNAL_GLOB */
 #endif /* !VMS */
 
     SAVESPTR(PL_last_in_gv);   /* We don't want this to be permanent. */
@@ -928,7 +932,7 @@ PP(pp_sselect)
     /* If SELECT_MIN_BITS is greater than one we most probably will want
      * to align the sizes with SELECT_MIN_BITS/8 because for example
      * in many little-endian (Intel, Alpha) systems (Linux, OS/2, Digital
-     * UNIX, Solaris, NeXT, Rhapsody) the smallest quantum select() operates
+     * UNIX, Solaris, NeXT, Darwin) the smallest quantum select() operates
      * on (sets/tests/clears bits) is 32 bits.  */
     growsize = maxlen + (SELECT_MIN_BITS/8 - (maxlen % (SELECT_MIN_BITS/8)));
 #  else
@@ -1076,7 +1080,7 @@ PP(pp_getc)
     GV *gv;
     MAGIC *mg;
 
-    if (MAXARG <= 0)
+    if (MAXARG == 0)
        gv = PL_stdingv;
     else
        gv = (GV*)POPs;
@@ -1686,7 +1690,7 @@ PP(pp_eof)
     GV *gv;
     MAGIC *mg;
 
-    if (MAXARG <= 0) {
+    if (MAXARG == 0) {
        if (PL_op->op_flags & OPf_SPECIAL) {    /* eof() */
            IO *io;
            gv = PL_last_in_gv = PL_argvgv;
@@ -1730,7 +1734,7 @@ PP(pp_tell)
     GV *gv;     
     MAGIC *mg;
 
-    if (MAXARG <= 0)
+    if (MAXARG == 0)
        gv = PL_last_in_gv;
     else
        gv = PL_last_in_gv = (GV*)POPs;
@@ -1965,7 +1969,7 @@ PP(pp_flock)
 
 #ifdef FLOCK
     argtype = POPi;
-    if (MAXARG <= 0)
+    if (MAXARG == 0)
        gv = PL_last_in_gv;
     else
        gv = (GV*)POPs;
@@ -3462,7 +3466,8 @@ PP(pp_readdir)
            sv = newSVpv(dp->d_name, 0);
 #endif
 #ifndef INCOMPLETE_TAINTS
-           SvTAINTED_on(sv);
+           if (!(IoFLAGS(io) & IOf_UNTAINT))
+               SvTAINTED_on(sv);
 #endif
            XPUSHs(sv_2mortal(sv));
        }
@@ -3476,7 +3481,8 @@ PP(pp_readdir)
        sv = newSVpv(dp->d_name, 0);
 #endif
 #ifndef INCOMPLETE_TAINTS
-       SvTAINTED_on(sv);
+       if (!(IoFLAGS(io) & IOf_UNTAINT))
+           SvTAINTED_on(sv);
 #endif
        XPUSHs(sv_2mortal(sv));
     }