strcasestr2.c

Go to the documentation of this file.
00001 //
00002 // Part of the ht://Dig package   <http://www.htdig.org/>
00003 // Copyright (c) 1999, 2000, 2001 The ht://Dig Group
00004 // For copyright details, see the file COPYING in your distribution
00005 // or the GNU General Public License version 2 or later 
00006 // <http://www.gnu.org/copyleft/gpl.html>
00007 //
00008 // $Id: strcasestr2_8c-source.html,v 1.1 2008/06/08 10:22:18 sebdiaz Exp $
00009 //
00010 
00011 #ifdef HAVE_CONFIG_H
00012 #include "config.h"
00013 #endif /* HAVE_CONFIG_H */
00014 
00015 #include <ctype.h>
00016 #include <string.h>
00017 
00018 #include <clib.h>
00019 
00020 //*****************************************************************************
00021 //
00022 const char *
00023 strcasestr(const char *s, const char *pattern)
00024 {
00025     int         length = strlen(pattern);
00026 
00027     while (*s)
00028     {
00029         if (strncasecmp(s, pattern, length) == 0)
00030             return s;
00031         s++;
00032     }
00033     return 0;
00034 }

Generated on Sun Jun 8 10:56:34 2008 for GNUmifluz by  doxygen 1.5.5