Change 30147 by [EMAIL PROTECTED] on 2007/02/06 21:48:59

        Subject: [PATCH] fix 2 environment handling bugs
        From: Jan Dubois <[EMAIL PROTECTED]>
        Date: Mon, 05 Feb 2007 21:45:36 -0800
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/perl.c#786 edit

Differences ...

==== //depot/perl/perl.c#786 (text) ====
Index: perl/perl.c
--- perl/perl.c#785~30119~      2007-02-04 12:32:13.000000000 -0800
+++ perl/perl.c 2007-02-06 13:48:59.000000000 -0800
@@ -1556,8 +1556,10 @@
                        break;
              }
         }
+
+#ifndef PERL_USE_SAFE_PUTENV
         /* Can we grab env area too to be used as the area for $0? */
-        if (s && PL_origenviron) {
+        if (s && PL_origenviron && !PL_use_safe_putenv) {
              if ((PL_origenviron[0] == s + 1)
                  ||
                  (aligned &&
@@ -1589,6 +1591,8 @@
                   }
              }
         }
+#endif /* !defined(PERL_USE_SAFE_PUTENV) */
+
         PL_origalen = s ? s - PL_origargv[0] + 1 : 0;
     }
 
@@ -4687,7 +4691,6 @@
            environ[0] = NULL;
        }
        if (env) {
-          char** origenv = environ;
          char *s;
          SV *sv;
          for (; *env; env++) {
@@ -4702,11 +4705,6 @@
            (void)hv_store(hv, *env, s - *env, sv, 0);
            if (env_is_not_environ)
                mg_set(sv);
-           if (origenv != environ) {
-             /* realloc has shifted us */
-             env = (env - origenv) + environ;
-             origenv = environ;
-           }
          }
       }
 #endif /* USE_ENVIRON_ARRAY */
End of Patch.

Reply via email to