=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/str.c,v retrieving revision 1.7 retrieving revision 1.8 diff -c -r1.7 -r1.8 *** src/usr.bin/make/str.c 1998/12/05 00:06:29 1.7 --- src/usr.bin/make/str.c 1999/11/11 11:35:17 1.8 *************** *** 1,4 **** ! /* $OpenBSD: str.c,v 1.7 1998/12/05 00:06:29 espie Exp $ */ /* $NetBSD: str.c,v 1.13 1996/11/06 17:59:23 christos Exp $ */ /*- --- 1,4 ---- ! /* $OpenBSD: str.c,v 1.8 1999/11/11 11:35:17 espie Exp $ */ /* $NetBSD: str.c,v 1.13 1996/11/06 17:59:23 christos Exp $ */ /*- *************** *** 43,49 **** #if 0 static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; #else ! static char rcsid[] = "$OpenBSD: str.c,v 1.7 1998/12/05 00:06:29 espie Exp $"; #endif #endif /* not lint */ --- 43,49 ---- #if 0 static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; #else ! static char rcsid[] = "$OpenBSD: str.c,v 1.8 1999/11/11 11:35:17 espie Exp $"; #endif #endif /* not lint */ *************** *** 223,266 **** done: argv[argc] = (char *)NULL; *store_argc = argc; return(argv); - } - - /* - * Str_FindSubstring -- See if a string contains a particular substring. - * - * Results: If string contains substring, the return value is the location of - * the first matching instance of substring in string. If string doesn't - * contain substring, the return value is NULL. Matching is done on an exact - * character-for-character basis with no wildcards or special characters. - * - * Side effects: None. - */ - char * - Str_FindSubstring(string, substring) - register char *string; /* String to search. */ - char *substring; /* Substring to find in string */ - { - register char *a, *b; - - /* - * First scan quickly through the two strings looking for a single- - * character match. When it's found, then compare the rest of the - * substring. - */ - - for (b = substring; *string != 0; string += 1) { - if (*string != *b) - continue; - a = string; - for (;;) { - if (*b == 0) - return(string); - if (*a++ != *b++) - break; - } - b = substring; - } - return((char *) NULL); } /* --- 223,228 ----