os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/compat/strstr.c
Update contrib.
4 * Source code for the "strstr" library routine.
6 * Copyright (c) 1988-1993 The Regents of the University of California.
7 * Copyright (c) 1994 Sun Microsystems, Inc.
9 * See the file "license.terms" for information on usage and redistribution
10 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12 * RCS: @(#) $Id: strstr.c,v 1.3.2.1 2005/04/12 18:28:56 kennykb Exp $
21 *----------------------------------------------------------------------
25 * Locate the first instance of a substring in a string.
28 * If string contains substring, the return value is the
29 * location of the first matching instance of substring
30 * in string. If string doesn't contain substring, the
31 * return value is 0. Matching is done on an exact
32 * character-for-character basis with no wildcards or special
38 *----------------------------------------------------------------------
42 strstr(string, substring)
43 register char *string; /* String to search. */
44 char *substring; /* Substring to try to find in string. */
48 /* First scan quickly through the two strings looking for a
49 * single-character match. When it's found, then compare the
50 * rest of the substring.
57 for ( ; *string != 0; string += 1) {