/[mailutils]/mailutils/imap4d/util.c
ViewVC logotype

Diff of /mailutils/imap4d/util.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.54 by gray, Mon Feb 3 11:27:02 2003 UTC revision 1.55 by gray, Sat Jul 26 11:07:27 2003 UTC
# Line 719  util_parse_ctime_date (const char *date, Line 719  util_parse_ctime_date (const char *date,
719  char *  char *
720  util_strcasestr (const char *haystack, const char *needle)  util_strcasestr (const char *haystack, const char *needle)
721  {  {
722    register char *needle_end = strchr (needle, '\0');    return mu_strcasestr (haystack, needle);
   register char *haystack_end = strchr (haystack, '\0');  
   register size_t needle_len = needle_end - needle;  
   register size_t needle_last = needle_len - 1;  
   register const char *begin;  
   
   if (needle_len == 0)  
     return (char *) haystack_end;  
   
   if ((size_t) (haystack_end - haystack) < needle_len)  
     return NULL;  
   
   for (begin = &haystack[needle_last]; begin < haystack_end; ++begin)  
     {  
       register const char *n = &needle[needle_last];  
       register const char *h = begin;  
   
       do  
         if (tolower (*h) != tolower (*n))  
           goto loop;            /* continue for loop */  
       while (--n >= needle && --h >= haystack);  
   
       return (char *) h;  
   
     loop:;  
     }  
   
   return NULL;  
723  }  }
724    
   
725  struct  struct
726  {  {
727    char *name;    char *name;

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26