httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_rewrite.c
Date Wed, 23 Jul 2003 13:32:15 GMT
nd          2003/07/23 06:32:14

  Modified:    modules/mappers mod_rewrite.c
  Log:
  don't compute the strlen of dconf->directory three times
  
  Submitted by: Justin
  
  Revision  Changes    Path
  1.168     +5 -5      httpd-2.0/modules/mappers/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_rewrite.c,v
  retrieving revision 1.167
  retrieving revision 1.168
  diff -u -r1.167 -r1.168
  --- mod_rewrite.c	18 Jul 2003 00:38:44 -0000	1.167
  +++ mod_rewrite.c	23 Jul 2003 13:32:14 -0000	1.168
  @@ -1449,7 +1449,7 @@
       char *cp2;
       const char *ccp;
       char *prefix;
  -    int l;
  +    apr_size_t l;
       int rulestatus;
       int n;
       char *ofilename;
  @@ -1478,10 +1478,10 @@
        *  URL: http://localhost/foo  and .htaccess is located in foo directory
        *  Ignore such attempts, since they may lead to undefined behaviour.
        */
  -    if (r->filename &&
  -        strlen(r->filename) == strlen(dconf->directory) - 1 &&
  -        (dconf->directory)[strlen(dconf->directory) - 1] == '/' &&
  -        !strncmp(r->filename, dconf->directory, strlen(dconf->directory) - 1))
{
  +    l = strlen(dconf->directory) - 1;
  +    if (r->filename && strlen(r->filename) == l &&
  +        (dconf->directory)[l] == '/' &&
  +        !strncmp(r->filename, dconf->directory, l)) {
           return DECLINED;
       }
   
  
  
  

Mime
View raw message