xref: /original-bsd/usr.bin/uucp/port/strpbrk.c (revision 81aa1937)
1 /*-
2  * Copyright (c) 1985 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.proprietary.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)strpbrk.c	5.2 (Berkeley) 04/24/91";
10 #endif /* not lint */
11 
12 /*LINTLIBRARY*/
13 
14 /*
15  * this is like index, but takes a string as the second argument
16  */
17 char *
18 strpbrk(str, chars)
19 register char *str, *chars;
20 {
21 	register char *cp;
22 
23 	do {
24 		cp = chars - 1;
25 		while (*++cp) {
26 			if (*str == *cp)
27 				return str;
28 		}
29 	} while (*str++);
30 	return (char *)0;
31 }
32