Re: [BUG] line numbering off-by-one with Apache::DB and RegistryCooker
[prev]
[thread]
[next]
[Date index for 2005/03/14]
Dominique Quatravaux wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Because ModPerl::RegistryCooker->rewrite_shebang() adds a line on top
> of the file in order to honor e.g. the "-w" in "#!/usr/bin/perl -w",
> the debugger loses count.
>
> The (trivial) patch below against SVN trunk fixes that (the "use
> warnings; " statement now gets added on the same line).
>
> And yes, it means that I succeeded in running Apache::DB with mod_perl
> 2, even without -X! (It was just a stupid mistake on my part, actually
> Apache::DB works like a charm out-of-the-box with a preforked,
> multiprocess Apache).
>
> ===================================================================
> - --- ModPerl-Registry/lib/ModPerl/RegistryCooker.pm (revision 157426)
> +++ ModPerl-Registry/lib/ModPerl/RegistryCooker.pm (working copy)
> @@ -556,7 +556,9 @@
> ~ # func: rewrite_shebang
> ~ # dflt: rewrite_shebang
> ~ # desc: parse the shebang line and convert command line switches
> - -# (defined in %switches) into a perl code.
> +# (defined in %switches) into a perl code. This routine must
> +# not shange the number of lines in the script, lest the #line
> +# statement be off-by-one in convert_script_to_compiled_handler().
> ~ # args: $self - registry blessed object
> ~ # rtrn: nothing
> ~ # efct: the CODE field gets adjusted
> @@ -569,7 +571,7 @@
> ~ unless ${^TAINT};
> ~ "";
> ~ },
> - - 'w' => sub { "use warnings;\n" },
> + 'w' => sub { "use warnings; " },
> ~ );
Thanks, Dominique. But care to post a unified patch? 'diff -u' Thanks!
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
 |
(message missing)
|