This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In Cwd's THX_unix_canonpath add two casts from (void*) to keep C++ sweet.
[perl5.git] / taint.c
diff --git a/taint.c b/taint.c
index 9a296db..e24f4f9 100644 (file)
--- a/taint.c
+++ b/taint.c
@@ -31,25 +31,14 @@ Perl_taint_proper(pTHX_ const char *f, const char *const s)
 
     PERL_ARGS_ASSERT_TAINT_PROPER;
 
-#   if Uid_t_size == 1
     {
-       const UV  uid = PerlProc_getuid();
-       const UV euid = PerlProc_geteuid();
+       const Uid_t  uid = PerlProc_getuid();
+       const Uid_t euid = PerlProc_geteuid();
 
        DEBUG_u(PerlIO_printf(Perl_debug_log,
-                              "%s %d %"UVuf" %"UVuf"\n",
+                              "%s %d %"Uid_t_f" %"Uid_t_f"\n",
                               s, TAINT_get, uid, euid));
     }
-#   else
-    {
-       const IV  uid = PerlProc_getuid();
-       const IV euid = PerlProc_geteuid();
-
-       DEBUG_u(PerlIO_printf(Perl_debug_log,
-                              "%s %d %"IVdf" %"IVdf"\n",
-                              s, TAINT_get, uid, euid));
-    }
-#   endif
 #endif
 
     if (TAINT_get) {
@@ -110,6 +99,9 @@ Perl_taint_env(pTHX)
            taint_proper("%%ENV is aliased to %%%s%s", name);
        /* this statement is reached under -t or -U */
        TAINT_set(was_tainted);
+#ifdef NO_TAINT_SUPPORT
+        PERL_UNUSED_VAR(was_tainted);
+#endif
     }
 
 #ifdef VMS
@@ -157,10 +149,14 @@ Perl_taint_env(pTHX)
        const bool was_tainted = TAINT_get;
        const char *t = SvPV_const(*svp, len);
        const char * const e = t + len;
+
        TAINT_set(was_tainted);
-       if (t < e && isALNUM(*t))
+#ifdef NO_TAINT_SUPPORT
+        PERL_UNUSED_VAR(was_tainted);
+#endif
+       if (t < e && isWORDCHAR(*t))
            t++;
-       while (t < e && (isALNUM(*t) || strchr("-_.+", *t)))
+       while (t < e && (isWORDCHAR(*t) || strchr("-_.+", *t)))
            t++;
        if (t < e) {
            TAINT;