> -----Original Message-----
> From: Vyacheslav Zamyatin [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 14, 2001 4:15 AM
> To: [EMAIL PROTECTED]
> Subject: bugfix in Apache::URI
> 
> 
> Hello all,
> 
> 
> Here is a small patch that prevents crash in the following example.
> 
> 
> $referer = 'http://some.host.com';
> $uri = Apache;:URI->parse($req,$referer);
> $page = $uri->rpath;
> 
> 
> If parsed uri don't have path at all, it'll dump core in the 
> last line.

hmmm...  well, mod_perl shouldn't have to dump core over this, but a path
component to the URI is required.

but, it's a problem that has bitten me once or twice as well, so perhaps we
ought to be helping the users somewhat in this case?  

what about defaulting the path to / if no path is present instead?  

I've actually thought about this in the past and wondered about the best
solution.  Ideas?

--Geoff

> 
> 
> 
> --- URI.xs      Mon Apr 10 18:07:07 2000
> +++ /root/src/mod_perl-1.24/src/modules/perl/URI.xs  Tue Aug 
> 14 11:17:57
> 2001
> @@ -92,7 +92,8 @@
>         RETVAL = newSVpv(uri->uri.path, set);
>      } 
>      else
> -        RETVAL = newSVpv(uri->uri.path, 0);
> +        if ( uri->uri.path )
> +            RETVAL = newSVpv(uri->uri.path, 0);
>  
>      OUTPUT:
>      RETVAL 
> 
> -- 
> See you in the Net,
> Slawa
> 

Reply via email to