diff options
author | josh <twists@gmail.com> | 2007-10-14 14:37:08 -0700 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-10-17 08:17:29 +0000 |
commit | 1e1d4b91957a9f66bbb14b2c7f1bbf88c1f89cdf (patch) | |
tree | ab06c1b94ecf038d0bb7b80ad7e53a8ece4b28a3 /pp_sys.c | |
parent | a5a709ec819bfe84b1af6f781d5d87ef68e00c3a (diff) | |
download | perl-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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)) |