You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@locus.apache.org on 2000/10/10 18:34:17 UTC
cvs commit: modperl/t/net/perl test
dougm 00/10/10 09:34:04
Modified: . Changes
Apache Apache.pm
t/internal http-get.t
t/net/perl test
Log:
fix bug in $r->args that treats ?0 as the empty string instead of zero
Revision Changes Path
1.544 +3 -0 modperl/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/modperl/Changes,v
retrieving revision 1.543
retrieving revision 1.544
diff -u -r1.543 -r1.544
--- Changes 2000/10/03 16:12:56 1.543
+++ Changes 2000/10/10 16:33:52 1.544
@@ -10,6 +10,9 @@
=item 1.24_01-dev
+fix bug in $r->args that treats ?0 as the empty string instead of zero,
+thanks to Matt Sergeant for the spot
+
add proper offset support to Apache::read
config/test fixups for libapreq/win32
1.57 +5 -3 modperl/Apache/Apache.pm
Index: Apache.pm
===================================================================
RCS file: /home/cvs/modperl/Apache/Apache.pm,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- Apache.pm 2000/10/03 20:58:58 1.56
+++ Apache.pm 2000/10/10 16:33:56 1.57
@@ -49,13 +49,15 @@
return unless $ct =~ m!^application/x-www-form-urlencoded!;
my $buff;
$r->read($buff, $r->header_in("Content-length"));
- parse_args(wantarray, $buff);
+ return $buff unless wantarray;
+ parse_args(1, $buff);
}
sub args {
my($r, $val) = @_;
- parse_args(wantarray,
- @_ > 1 ? $r->query_string($val) : $r->query_string);
+ my $args = @_ > 1 ? $r->query_string($val) : $r->query_string;
+ return $args unless wantarray;
+ parse_args(1, $args);
}
*READ = \&read unless defined &READ;
1.6 +3 -1 modperl/t/internal/http-get.t
Index: http-get.t
===================================================================
RCS file: /home/cvs/modperl/t/internal/http-get.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- http-get.t 1999/01/27 07:07:27 1.5
+++ http-get.t 2000/10/10 16:33:59 1.6
@@ -3,7 +3,7 @@
# Check GET via HTTP.
#
-my $num_tests = 9;
+my $num_tests = 10;
my(@test_scripts) = qw(test perl-status);
%get_only = map { $_,1 } qw(perl-status);
@@ -58,6 +58,8 @@
for (1..3) {
test ++$i, ($ua->request($request, undef, undef)->is_success);
}
+
+test ++$i, fetch("/perl/test?0") =~ /SCALAR_ARGS=0/;
# avoid -w warning
$dummy = $net::httpserver;
1.17 +3 -0 modperl/t/net/perl/test
Index: test
===================================================================
RCS file: /home/cvs/modperl/t/net/perl/test,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- test 2000/09/29 15:49:54 1.16
+++ test 2000/10/10 16:34:02 1.17
@@ -78,6 +78,9 @@
#Process $$ going to Apache::exit with status=$s
}
+my $scalar_args = $r->args;
+print "SCALAR_ARGS=$scalar_args\n" if defined $scalar_args;
+
if (@args = $r->args) {
$r->print(
"ARGS: ",