diff options
author | Craig A. Berry <craigberry@mac.com> | 2004-07-08 18:19:05 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-07-09 08:08:05 +0000 |
commit | ff79d39dc75833c4d7014282008680632389529f (patch) | |
tree | cef46e5d8b6ceded5756fff381e4c551c4bf059e /vms | |
parent | 5b304f34b36893c60dc4bd13dac6eee82bfce4c6 (diff) | |
download | perl-ff79d39dc75833c4d7014282008680632389529f.tar.gz |
prime_env_iter and zero-length values on VMS
From: "Craig A. Berry" <craigberry@mac.com>
Message-ID: <40EE1CB9.8030407@mac.com>
p4raw-id: //depot/perl@23071
Diffstat (limited to 'vms')
-rw-r--r-- | vms/vms.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -665,7 +665,21 @@ prime_env_iter(void) continue; } PERL_HASH(hash,key,keylen); - sv = newSVpvn(cp2,cp1 - cp2 + 1); + + if (cp1 == cp2 && *cp2 == '.') { + /* A single dot usually means an unprintable character, such as a null + * to indicate a zero-length value. Get the actual value to make sure. + */ + char lnm[LNM$C_NAMLENGTH+1]; + char eqv[LNM$C_NAMLENGTH+1]; + strncpy(lnm, key, keylen); + int trnlen = vmstrnenv(lnm, eqv, 0, fildev, 0); + sv = newSVpvn(eqv, strlen(eqv)); + } + else { + sv = newSVpvn(cp2,cp1 - cp2 + 1); + } + SvTAINTED_on(sv); hv_store(envhv,key,keylen,sv,hash); hv_store(seenhv,key,keylen,&PL_sv_yes,hash); |