Change 11510 by jhi@alpha on 2001/07/31 02:13:58
eval "format foo=" would loop indefinitely; reported in
Subject: A load of old rubbish
From: Mike Guy <[EMAIL PROTECTED]>
Date: Mon, 14 May 2001 16:12:22 +0100
Message-Id: <[EMAIL PROTECTED]>
(The core dumps reported in there already fixed.)
Affected files ...
... //depot/perl/toke.c#377 edit
Differences ...
==== //depot/perl/toke.c#377 (text) ====
Index: perl/toke.c
--- perl/toke.c.~1~ Mon Jul 30 20:30:05 2001
+++ perl/toke.c Mon Jul 30 20:30:05 2001
@@ -7359,15 +7359,19 @@
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
}
-#endif
+ else
+ break;
}
s = eol;
if (PL_rsfp) {
End of Patch.