diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-09-08 13:49:22 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-09-08 14:39:02 -0700 |
commit | 7f1c3e8c83a47ee3cac4422211087cf7c29abc31 (patch) | |
tree | 274b22f07c2a2e97bc7bc56ebed20a0bdb694b46 /parser.h | |
parent | fdc18556701202efb38dee6dab4d8aff8b7d00eb (diff) | |
download | perl-7f1c3e8c83a47ee3cac4422211087cf7c29abc31.tar.gz |
Fix line numbers with #! -d:foo and PERL5DB=$'\n'
Commit 2179133 inadvertently stopped the PERL5DB env var from being
truncated just before the first line break. (I’m considering that
a bug fix.)
The result is that #!perl -d:foo will throw the line numbers off by
one, as will line breaks in PERL5DB:
$ PERL5DB='sub DB::DB{}'$'\n\n\n''' ./perl -dle 'warn "ok"'
ok at -e line 4.
#!perl -d:foo has thrown off line numbers since f0e67a1d291 in 5.12.
This commit fixes both, by storing the line number of #! -d or the
number 0 for -d on the command line in the new PL_parser->preambling
member, which now overrides any number in PL_curcop.
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -123,6 +123,7 @@ typedef struct yy_parser { COP *saved_curcop; /* the previous PL_curcop */ char tokenbuf[256]; line_t herelines; /* number of lines in here-doc */ + line_t preambling; /* line # when processing $ENV{PERL5DB} */ U8 lex_fakeeof; /* precedence at which to fake EOF */ U8 lex_flags; PERL_BITFIELD16 in_pod:1; /* lexer is within a =pod section */ |