From: Craig A. Berry Date: Thu, 11 Dec 2003 14:35:29 +0000 (-0600) Subject: environ array fix for VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=299d126a2f8dc481e487c65c8917d2ed546b48b3;p=p5sagit%2Fp5-mst-13.2.git environ array fix for VMS From: "Craig A. Berry" Message-ID: <3FD8D511.2030805@mac.com> p4raw-id: //depot/perl@21879 --- diff --git a/vms/vms.c b/vms/vms.c index 10bec68..1bbc960 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -222,6 +222,7 @@ Perl_vmstrnenv(const char *lnm, char *eqv, unsigned long int idx, retsts = SS$_NOLOGNAM; for (i = 0; environ[i]; i++) { if ((eq = strchr(environ[i],'=')) && + lnmdsc.dsc$w_length == (eq - environ[i]) && !strncmp(environ[i],uplnm,eq - environ[i])) { eq++; for (eqvlen = 0; eq[eqvlen]; eqvlen++) eqv[eqvlen] = eq[eqvlen]; @@ -733,8 +734,9 @@ Perl_vmssetenv(pTHX_ char *lnm, char *eqv, struct dsc$descriptor_s **tabvec) for (curtab = 0; tabvec[curtab]; curtab++) { if (!ivenv && !str$case_blind_compare(tabvec[curtab],&crtlenv)) { int i; - for (i = 0; environ[i]; i++) { /* Iff it's an environ elt, reset */ + for (i = 0; environ[i]; i++) { /* If it's an environ elt, reset */ if ((cp1 = strchr(environ[i],'=')) && + lnmdsc.dsc$w_length == (cp1 - environ[i]) && !strncmp(environ[i],lnm,cp1 - environ[i])) { #ifdef HAS_SETENV return setenv(lnm,"",1) ? vaxc$errno : 0;