summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-04-05 19:45:42 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-04-05 19:45:42 +0000
commit9ae3433d9acf2239ad936d472a709712f4962dc3 (patch)
tree9e519a81b5f224cfbb1be0e5c3f83e1874ca679f /mg.c
parent2c1c1caaefc9a6157e7d86987f121276e2115620 (diff)
downloadperl-9ae3433d9acf2239ad936d472a709712f4962dc3.tar.gz
Assigning undef to an entry in %ENV shouldn't produce warnings, even
though it's silently converted to "" p4raw-id: //depot/perl@27725
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mg.c b/mg.c
index 268e0673f7..82f63c007d 100644
--- a/mg.c
+++ b/mg.c
@@ -1042,8 +1042,8 @@ int
Perl_magic_setenv(pTHX_ SV *sv, MAGIC *mg)
{
dVAR;
- STRLEN len, klen;
- const char *s = SvPV_const(sv,len);
+ STRLEN len = 0, klen;
+ const char *s = SvOK(sv) ? SvPV_const(sv,len) : "";
const char * const ptr = MgPV_const(mg,klen);
my_setenv(ptr, s);