summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorjosh <twists@gmail.com>2007-10-14 14:37:08 -0700
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-10-17 08:17:29 +0000
commit1e1d4b91957a9f66bbb14b2c7f1bbf88c1f89cdf (patch)
treeab06c1b94ecf038d0bb7b80ad7e53a8ece4b28a3 /pp_sys.c
parenta5a709ec819bfe84b1af6f781d5d87ef68e00c3a (diff)
downloadperl-1e1d4b91957a9f66bbb14b2c7f1bbf88c1f89cdf.tar.gz
Fix a few segfaults and a when() bug
From: "josh" <twists@gmail.com> Message-ID: <20071015043708.GA10981@grenekatz.org> p4raw-id: //depot/perl@32120
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 7770dc2730..6aa86455e8 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2012,7 +2012,12 @@ PP(pp_eof)
IoLINES(io) = 0;
IoFLAGS(io) &= ~IOf_START;
do_open(gv, "-", 1, FALSE, O_RDONLY, 0, NULL);
- sv_setpvn(GvSV(gv), "-", 1);
+ if ( GvSV(gv) ) {
+ sv_setpvn(GvSV(gv), "-", 1);
+ }
+ else {
+ GvSV(gv) = newSVpvn("-", 1);
+ }
SvSETMAGIC(GvSV(gv));
}
else if (!nextargv(gv))