On Tue, 3 Jul 2001, Geoffrey Young wrote:

> hi guys...
> 
>   I tried using the -T and -B file tests against $r->finfo and found they
> didn't work.  I'm guessing this is because -T and -B are special perl tests
> that have to read in the file, and that Apache's stat() doesn't glean this
> information on its own.

i think those tests will work with this (untested) patch..

Index: src/modules/perl/Apache.xs
===================================================================
RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
retrieving revision 1.123
diff -u -r1.123 Apache.xs
--- src/modules/perl/Apache.xs  2001/06/14 05:26:28     1.123
+++ src/modules/perl/Apache.xs  2001/07/06 13:58:47
@@ -1956,9 +1956,11 @@
     statcache = r->finfo;
     if (r->finfo.st_mode) {
        laststatval = 0;
+        sv_setpv(statname, r->filename);
     }
     else {
        laststatval = -1;
+        sv_setpv(statname, "");
     }
     if(GIMME_V == G_VOID) XSRETURN_UNDEF;
     RETVAL = newRV_noinc((SV*)gv_fetchpv("_", TRUE, SVt_PVIO));
Index: src/modules/perl/perl_PL.h
===================================================================
RCS file: /home/cvs/modperl/src/modules/perl/perl_PL.h,v
retrieving revision 1.7
diff -u -r1.7 perl_PL.h
--- src/modules/perl/perl_PL.h  1999/01/18 03:26:19     1.7
+++ src/modules/perl/perl_PL.h  2001/07/06 13:58:47
@@ -19,6 +19,9 @@
 #ifndef laststatval
 #define laststatval PL_laststatval
 #endif
+#ifndef statname
+#define statname PL_statname
+#endif
 #ifndef rs
 #define rs PL_rs
 #endif


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

Reply via email to