summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-04-28 18:17:07 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-04-28 18:17:07 +0000
commitdf0deb90068dea6e06bd6632928a2926975901ce (patch)
treed843359b2d5a6d0af22ce1f6f61d0ea3f16688d4 /toke.c
parentd5a71f3055c3a1145f32dafabd5c3bba8ef27f4d (diff)
downloadperl-df0deb90068dea6e06bd6632928a2926975901ce.tar.gz
fix line renumbering bug in C<eval qq[#line 10 "X"\nwarn]>
p4raw-id: //depot/perl@5999
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index 5c1b945cba..737c9aef89 100644
--- a/toke.c
+++ b/toke.c
@@ -2656,6 +2656,11 @@ Perl_yylex(pTHX)
case '#':
case '\n':
if (PL_lex_state != LEX_NORMAL || (PL_in_eval && !PL_rsfp)) {
+ if (*s == '#' && s == PL_linestart && PL_in_eval && !PL_rsfp) {
+ /* handle eval qq[#line 1 "foo"\n ...] */
+ CopLINE_dec(PL_curcop);
+ incline(s);
+ }
d = PL_bufend;
while (s < d && *s != '\n')
s++;