Bruce Langlois <[EMAIL PROTECTED]> writes:

> I have encountered what I consider a bug in the 'param' method
> of Apache::Request in mod_perl 1.  The method returns a
> list of parameters, or a '0' if no parameters are found.

[...]

> The documentation does not specify what the actual return should be in
> the case where there are no parameters, but it seems to me that an
> empty list would be more appropriate than a '0'. 

Returning '0' instead of an empty list is a bug.
See if this patch helps:

Index: Request/Request.xs
===================================================================
RCS file: /home/cvs/httpd-apreq/Request/Request.xs,v
retrieving revision 1.37
diff -u -r1.37 Request.xs
--- Request/Request.xs  5 Jul 2003 02:35:20 -0000       1.37
+++ Request/Request.xs  11 Nov 2003 21:24:30 -0000
@@ -424,6 +424,7 @@
                I32 i;
                array_header *arr  = ap_table_elts(req->parms);
                table_entry *elts = (table_entry *)arr->elts;
+                XSprePUSH;
                for (i = 0; i < arr->nelts; ++i) {
                    if (elts[i].key && strcaseEQ(elts[i].key, key))
                        XPUSHs(sv_2mortal(newSVpv(elts[i].val,0)));
@@ -449,6 +450,7 @@
                I32 i;
                array_header *arr  = ap_table_elts(req->parms);
                table_entry *elts = (table_entry *)arr->elts;
+                XSprePUSH;
                for (i = 0; i < arr->nelts; ++i) {
                    I32 j;
                   if (!elts[i].key) continue;

-- 
Joe Schaefer


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to