diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-05-06 05:14:35 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-05-06 05:14:35 +0000 |
commit | e3a964198ee49779af87d8c10ddbf4ea1659a8eb (patch) | |
tree | f32bc7bbe034f41226b2d839faca2047b5065e4a /toke.c | |
parent | 768826cffa7a31145654e4ae6506ebcd59955436 (diff) | |
download | perl-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.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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++; |