summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-11-17 06:32:39 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-11-17 06:32:39 +0000
commit60e6418e713a685accbfac231ad24b33f7569c3a (patch)
tree20623cdf73bd1bb5fc60ae3ada0b7543696df3cd /toke.c
parent6f06b55ffd47b279dd1684acb9b556a45e4754a3 (diff)
downloadperl-60e6418e713a685accbfac231ad24b33f7569c3a.tar.gz
fix skipspace() to properly account for newlines in eval''-ed
strings (caused bogus line numbers in diagnostics and debugger) p4raw-id: //depot/perl@2242
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/toke.c b/toke.c
index 6755b8aaef..fb54cee87c 100644
--- a/toke.c
+++ b/toke.c
@@ -445,13 +445,20 @@ skipspace(register char *s)
}
for (;;) {
STRLEN prevlen;
- while (s < PL_bufend && isSPACE(*s))
- s++;
+ while (s < PL_bufend && isSPACE(*s)) {
+ if (*s++ == '\n' && PL_in_eval && !PL_rsfp)
+ incline(s);
+ }
if (s < PL_bufend && *s == '#') {
while (s < PL_bufend && *s != '\n')
s++;
- if (s < PL_bufend)
+ if (s < PL_bufend) {
s++;
+ if (PL_in_eval && !PL_rsfp) {
+ incline(s);
+ continue;
+ }
+ }
}
if (s < PL_bufend || !PL_rsfp || PL_lex_state != LEX_NORMAL)
return s;