summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-05-06 05:14:35 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-05-06 05:14:35 +0000
commite3a964198ee49779af87d8c10ddbf4ea1659a8eb (patch)
treef32bc7bbe034f41226b2d839faca2047b5065e4a /toke.c
parent768826cffa7a31145654e4ae6506ebcd59955436 (diff)
downloadperl-e3a964198ee49779af87d8c10ddbf4ea1659a8eb.tar.gz
emit more accurate diagnostic for syntax errors involving <>
within eval"" p4raw-id: //depot/perl@3310
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/toke.c b/toke.c
index b4a3d1dd43..e77648591d 100644
--- a/toke.c
+++ b/toke.c
@@ -5669,19 +5669,23 @@ scan_inputsymbol(char *start)
register char *s = start; /* current position in buffer */
register char *d;
register char *e;
+ char *end;
I32 len;
d = PL_tokenbuf; /* start of temp holding space */
e = PL_tokenbuf + sizeof PL_tokenbuf; /* end of temp holding space */
- s = delimcpy(d, e, s + 1, PL_bufend, '>', &len); /* extract until > */
+ end = strchr(s, '\n');
+ if (!end)
+ end = PL_bufend;
+ s = delimcpy(d, e, s + 1, end, '>', &len); /* extract until > */
/* die if we didn't have space for the contents of the <>,
- or if it didn't end
+ or if it didn't end, or if we see a newline
*/
if (len >= sizeof PL_tokenbuf)
croak("Excessively long <> operator");
- if (s >= PL_bufend)
+ if (s >= end)
croak("Unterminated <> operator");
s++;