diff options
author | Mike Guy <mjtg@cam.ac.uk> | 2001-05-14 17:12:22 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-07-31 02:13:58 +0000 |
commit | 7121b3475484a520ee84b25696f18e1af9a30745 (patch) | |
tree | 4419df4b09fc179567f133d1fd65afbd2cfcc913 /toke.c | |
parent | 74a6a946f443cceaa57e35bcb28c0276e02a0ae8 (diff) | |
download | perl-7121b3475484a520ee84b25696f18e1af9a30745.tar.gz |
eval "format foo=" would loop indefinitely; reported in
Subject: A load of old rubbish
Message-Id: <E14zK1G-0003a2-00@virgo.cus.cam.ac.uk>
(The core dumps reported in there already fixed.)
p4raw-id: //depot/perl@11510
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -7359,15 +7359,19 @@ S_scan_formline(pTHX_ register char *s) if (*t == '@' || *t == '^') needargs = TRUE; } - sv_catpvn(stuff, s, eol-s); + if (eol > s) { + sv_catpvn(stuff, s, eol-s); #ifndef PERL_STRICT_CR - if (eol-s > 1 && eol[-2] == '\r' && eol[-1] == '\n') { - char *end = SvPVX(stuff) + SvCUR(stuff); - end[-2] = '\n'; - end[-1] = '\0'; - SvCUR(stuff)--; - } + if (eol-s > 1 && eol[-2] == '\r' && eol[-1] == '\n') { + char *end = SvPVX(stuff) + SvCUR(stuff); + end[-2] = '\n'; + end[-1] = '\0'; + SvCUR(stuff)--; + } #endif + } + else + break; } s = eol; if (PL_rsfp) { |