perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
Date Wed, 14 Nov 2001 08:35:14 GMT
Doug MacEachern wrote:

> On Tue, 13 Nov 2001, Stas Bekman wrote:
>  
> 
>>ap_server_root_relative return the dir incliding the trailing / if
>>fname==NULL, which is bad. 
>>
> 
> need to do some research here:
> - what does 1.x do?  if adds trailing /, then leave it alone


I've tested, it has a trailing /


It's possible that nobody used this before, so the bogosity wasn't noticed. 


The header doesn't define the case where fname == NULL:

/**
  * For modules which need to read config files, open logs, etc. this 
returns
  * the canonical form of fname made absolute to ap_server_root.
  * @param p pool to allocate data from
  * @param fname The file name
  */
AP_DECLARE(char *) ap_server_root_relative(apr_pool_t *p, const char 
*fname);

Do you think this patch makes sense? or should this be handled on the 
apr_filepath_merge level?

Index: server/config.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/config.c,v
retrieving revision 1.136
diff -u -r1.136 config.c
--- server/config.c	2001/10/07 04:54:53	1.136
+++ server/config.c	2001/11/14 08:15:10
@@ -1184,7 +1184,9 @@
  AP_DECLARE(char *) ap_server_root_relative(apr_pool_t *p, const char 
*file)
  {
      char *newpath;
-    if (apr_filepath_merge(&newpath, ap_server_root, file,
+    if (!file)
+        return ap_server_root;
+    else if (apr_filepath_merge(&newpath, ap_server_root, file,
                             APR_FILEPATH_TRUENAME, p) == APR_SUCCESS)
          return newpath;
      else

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message