Bug#226131: $r->dir_config('foo') returns undef instead of 0 when PerlSetVar foo '0'
Hi Don,
can you test the patch and come back to me?
Fabio
On Sat, 3 Jan 2004, Don Armstrong wrote:
> Package: libapache-mod-perl
> Version: 1.29.0.1-3
> Severity: important
> Tags: patch
>
> An apache configuration with:
>
> <Location />
> PerlSetVar foo '0';
> </Location>
>
> Causes $r->dir_config('foo') to return undef unstead of zero. However,
> $r->dir_config returns a hashref with the appropriate values set.
>
> Apparently, the following patch[1] fixes this issue, but I have not yet
> tried it myself. (It looks reasonable though...)
>
> Index: src/modules/perl/Apache.xs
> ===================================================================
> RCS file: /home/cvspublic/modperl/src/modules/perl/Apache.xs,v
> retrieving revision 1.129
> diff -u -r1.129 Apache.xs
> --- src/modules/perl/Apache.xs 16 Sep 2003 19:51:06 -0000 1.129
> +++ src/modules/perl/Apache.xs 25 Nov 2003 20:39:41 -0000
> @@ -2084,7 +2084,7 @@
> &perl_module);
> TABLE_GET_SET(c->vars, FALSE);
> }
> - if (!SvTRUE(RETVAL)) {
> + if (!SvOK(RETVAL)) {
> s = r && r->server ? r->server : perl_get_startup_server();
> if (s && s->module_config) {
> SvREFCNT_dec(RETVAL); /* in case above did newSV(0) */
>
>
> Don Armstrong
>
> 1: http://www.gossamer-threads.com/archive/mod_perl_C1/modperl_F7/PerlSetVar_with_0_value_P90608/
>
--
Our mission: make IPv6 the default IP protocol
"We are on a mission from God" - Elwood Blues
http://www.itojun.org/paper/itojun-nanog-200210-ipv6isp/mgp00004.html
Reply to: