On Sun, 30 Nov 2003, Stas Bekman wrote:

> Randy Kobes wrote:
> > In one of the redirect tests of ModPerl-Registry, catfile
> > is used to construct the location of a script, which for
> > non-unix doesn't use '/' as the directory separator. This
> > ===========================================================
> > Index: ModPerl-Registry/t/redirect.t
> > ===================================================================
> > RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/redirect.t,v
> > retrieving revision 1.6
> > diff -u -r1.6 redirect.t
> > --- ModPerl-Registry/t/redirect.t   23 Nov 2003 21:01:50 -0000      1.6
> > +++ ModPerl-Registry/t/redirect.t   29 Nov 2003 14:28:38 -0000
> > @@ -16,7 +16,7 @@
> >      my $redirect_path = "/registry/basic.pl";
> >      my $url = "$base_url?$redirect_path";
> >      my $vars = Apache::Test::config()->{vars};
> > -    my $script_file = catfile $vars->{serverroot}, 'cgi-bin', 'basic.pl';
> > +    my $script_file = $vars->{serverroot} . '/cgi-bin/basic.pl';
> >
> >      ok t_cmp(
> >          "ok $script_file",
> > ====================================================================
> > fixes it.
> >
> > Another option might be to
> >
> > use File::Spec::Unix;
> > my $script = File::Spec::Unix->catfile($var1, $var2);
>
> Ah, what do you get as a response? a path like /tmp/foo.pl on win32? In which
> case the problem would be coming from:
>
>      $_[0]->{FILENAME} = $_[1]->filename;
>
> in RegistryCooker.pm, which sets $0, eventually printed by cgi-bin/basic.pl.
> Does $r->filename return a unix path on winFU?

I guess one could look at it from both ends ... I was
thinking here that the problem was in the way that
$script_file was constructed with catfile, which on
Win32 came out as SERVER_ROOT\cgi-bin\basic.pl. So the
patch above changes this to SERVER_ROOT/cgi-bin/basic.pl,
which agrees with the response.

-- 
best regards,
randy


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to