diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-17 06:32:39 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-17 06:32:39 +0000 |
commit | 60e6418e713a685accbfac231ad24b33f7569c3a (patch) | |
tree | 20623cdf73bd1bb5fc60ae3ada0b7543696df3cd /toke.c | |
parent | 6f06b55ffd47b279dd1684acb9b556a45e4754a3 (diff) | |
download | perl-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.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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; |