FreeBSD/contrib/libucl/src/ucl_util.c
/*
 * Find the first occurrence of find in s, ignore case.
 */
Find the first occurrence of find in s, ignore case.
Find the first occurrence of find in s ignore case .
char *
ucl_strncasestr (const char *s, const char *find, int len)
{
	char c, sc;
	int mlen;
	if ((c = *find++) != 0) {
		c = tolower (c);
		mlen = strlen (find);
		do {
			do {
				if ((sc = *s++) == 0 || len-- == 0)
					return (NULL);
			} while (tolower (sc) != c);
		} while (strncasecmp (s, find, mlen) != 0);
		s--;
	}
	return ((char *)s);
}
char * ucl_strncasestr ( const char * s , const char * find , int len ) { char c , sc ; int mlen ; if ( ( c = * find ++ ) != 0 ) { c = tolower ( c ) ; mlen = strlen ( find ) ; do { do { if ( ( sc = * s ++ ) == 0 || len -- == 0 ) return ( NULL ) ; } while ( tolower ( sc ) != c ) ; } while ( strncasecmp ( s , find , mlen ) != 0 ) ; s -- ; } return ( ( char * ) s ) ; }
Find the first occurrence of find in s, ignore case.
Find the first occurrence of find in s ignore case .