httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/include httpd.h
Date Sun, 23 Jun 2002 09:01:22 GMT
brianp      2002/06/23 02:01:22

  Modified:    server   util.c
               include  httpd.h
  Log:
  Removed "tolower(++s)" idiom from ap_strcasestr(), to avoid side-effects
  on any platform with a macro-based tolower() that references its argument
  multiple times.
  
  Revision  Changes    Path
  1.129     +1 -1      httpd-2.0/server/util.c
  
  Index: util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/util.c,v
  retrieving revision 1.128
  retrieving revision 1.129
  diff -u -r1.128 -r1.129
  --- util.c	17 May 2002 11:11:37 -0000	1.128
  +++ util.c	23 Jun 2002 09:01:21 -0000	1.129
  @@ -327,7 +327,7 @@
   	/* found first character of s2, see if the rest matches */
           p1 = (char *)s1;
           p2 = (char *)s2;
  -        while (apr_tolower(*++p1) == apr_tolower(*++p2)) {
  +        for (++p1, ++p2; apr_tolower(*p1) == apr_tolower(*p2); ++p1, ++p2) {
               if (*p1 == '\0') {
                   /* both strings ended together */
                   return((char *)s1);
  
  
  
  1.187     +1 -0      httpd-2.0/include/httpd.h
  
  Index: httpd.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/httpd.h,v
  retrieving revision 1.186
  retrieving revision 1.187
  diff -u -r1.186 -r1.187
  --- httpd.h	15 Jun 2002 19:19:42 -0000	1.186
  +++ httpd.h	23 Jun 2002 09:01:22 -0000	1.187
  @@ -1453,6 +1453,7 @@
    * @param s1 The string to search
    * @param s2 The substring to search for
    * @return A pointer to the beginning of the substring
  + * @remark See apr_strmatch() for a faster alternative
    */
   AP_DECLARE(char *) ap_strcasestr(const char *s1, const char *s2);
   
  
  
  

Mime
View raw message