apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: apr-util/strmatch apr_strmatch.c
Date Fri, 24 May 2002 01:07:47 GMT
brianp      02/05/23 18:07:47

  Modified:    strmatch apr_strmatch.c
  Log:
  Switched to unsigned chars in the searching functions to avoid
  problems when input strings contain character values > 127
  Reported by: Cliff Woolley
  
  Revision  Changes    Path
  1.3       +12 -12    apr-util/strmatch/apr_strmatch.c
  
  Index: apr_strmatch.c
  ===================================================================
  RCS file: /home/cvs/apr-util/strmatch/apr_strmatch.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apr_strmatch.c	24 May 2002 00:29:23 -0000	1.2
  +++ apr_strmatch.c	24 May 2002 01:07:47 -0000	1.3
  @@ -110,14 +110,14 @@
   
   APU_DECLARE_NONSTD(const char *) match_boyer_moore_horspool(const apr_strmatch_pattern
*this_pattern, const char *s, apr_size_t slen)
   {
  -    const char *s_end = s + slen;
  +    const unsigned char *s_end = s + slen;
       int *shift = (int *)(this_pattern->context);
  -    const char *s_next = s + this_pattern->length - 1;
  -    const char *p_start = this_pattern->pattern;
  -    const char *p_end = p_start + this_pattern->length - 1;
  +    const unsigned char *s_next = s + this_pattern->length - 1;
  +    const unsigned char *p_start = this_pattern->pattern;
  +    const unsigned char *p_end = p_start + this_pattern->length - 1;
       while (s_next < s_end) {
  -        const char *s_tmp = s_next;
  -        const char *p_tmp = p_end;
  +        const unsigned char *s_tmp = s_next;
  +        const unsigned char *p_tmp = p_end;
           while (*s_tmp == *p_tmp) {
               p_tmp--;
               if (p_tmp < p_start) {
  @@ -132,14 +132,14 @@
   
   APU_DECLARE_NONSTD(const char *) match_boyer_moore_horspool_nocase(const apr_strmatch_pattern
*this_pattern, const char *s, apr_size_t slen)
   {
  -    const char *s_end = s + slen;
  +    const unsigned char *s_end = s + slen;
       int *shift = (int *)(this_pattern->context);
  -    const char *s_next = s + this_pattern->length - 1;
  -    const char *p_start = this_pattern->pattern;
  -    const char *p_end = p_start + this_pattern->length - 1;
  +    const unsigned char *s_next = s + this_pattern->length - 1;
  +    const unsigned char *p_start = this_pattern->pattern;
  +    const unsigned char *p_end = p_start + this_pattern->length - 1;
       while (s_next < s_end) {
  -        const char *s_tmp = s_next;
  -        const char *p_tmp = p_end;
  +        const unsigned char *s_tmp = s_next;
  +        const unsigned char *p_tmp = p_end;
           while (apr_tolower(*s_tmp) == apr_tolower(*p_tmp)) {
               p_tmp--;
               if (p_tmp < p_start) {
  
  
  

Mime
View raw message