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 Thu, 24 Jul 2003 23:25:31 GMT
nd          2003/07/24 16:25:31

  Modified:    modules/mappers mod_rewrite.c
  Log:
  avoid unnecessary memory operation
  
  Revision  Changes    Path
  1.177     +6 -8      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.176
  retrieving revision 1.177
  diff -u -r1.176 -r1.177
  --- mod_rewrite.c	24 Jul 2003 23:10:29 -0000	1.176
  +++ mod_rewrite.c	24 Jul 2003 23:25:31 -0000	1.177
  @@ -1377,7 +1377,6 @@
       char *cp;
       char *cp2;
       const char *ccp;
  -    char *prefix;
       apr_size_t l;
       int rulestatus;
       int n;
  @@ -1616,14 +1615,13 @@
                    * document_root if it is prefix
                    */
                   if ((ccp = ap_document_root(r)) != NULL) {
  -                    prefix = apr_pstrdup(r->pool, ccp);
  -                    /* always NOT have a trailing slash */
  -                    l = strlen(prefix);
  -                    if (prefix[l-1] == '/') {
  -                        prefix[l-1] = '\0';
  -                        l--;
  +                    /* strip trailing slash */
  +                    l = strlen(ccp);
  +                    if (ccp[l-1] == '/') {
  +                        --l;
                       }
  -                    if (strncmp(r->filename, prefix, l) == 0) {
  +                    if (!strncmp(r->filename, ccp, l) &&
  +                        r->filename[l] == '/') {
                           rewritelog(r, 2,
                                      "[per-dir %s] strip document_root "
                                      "prefix: %s -> %s",
  
  
  

Mime
View raw message