From: Gurusamy Sarathy <gsar@cpan.org>
Date: Sat, 4 Mar 2000 03:59:07 +0000 (+0000)
Subject: avoid warnings from shmread() when given undefined variable
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f538c0458a40ff03fab4dd6c72f8e1e0960f80a;p=p5sagit%2Fp5-mst-13.2.git

avoid warnings from shmread() when given undefined variable
(from Tom Christiansen)

p4raw-id: //depot/perl@5504
---

diff --git a/doio.c b/doio.c
index d818185..d0a7704 100644
--- a/doio.c
+++ b/doio.c
@@ -1849,6 +1849,9 @@ Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp)
     if (shm == (char *)-1)	/* I hate System V IPC, I really do */
 	return -1;
     if (optype == OP_SHMREAD) {
+	/* suppress warning when reading into undef var (tchrist 3/Mar/00) */
+	if (! SvOK(mstr))
+	    sv_setpvn(mstr, "", 0);
 	SvPV_force(mstr, len);
 	mbuf = SvGROW(mstr, msize+1);