xref: /csrg-svn/lib/libc/string/strpbrk.c (revision 34831)
124191Skre /*
224191Skre  * Copyright (c) 1985 Regents of the University of California.
334479Sbostic  * All rights reserved.
434479Sbostic  *
534479Sbostic  * Redistribution and use in source and binary forms are permitted
6*34831Sbostic  * provided that the above copyright notice and this paragraph are
7*34831Sbostic  * duplicated in all such forms and that any documentation,
8*34831Sbostic  * advertising materials, and other materials related to such
9*34831Sbostic  * distribution and use acknowledge that the software was developed
10*34831Sbostic  * by the University of California, Berkeley.  The name of the
11*34831Sbostic  * University may not be used to endorse or promote products derived
12*34831Sbostic  * from this software without specific prior written permission.
13*34831Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*34831Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*34831Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1624191Skre  */
1724191Skre 
1826535Sdonn #if defined(LIBC_SCCS) && !defined(lint)
19*34831Sbostic static char sccsid[] = "@(#)strpbrk.c	5.4 (Berkeley) 06/27/88";
2034479Sbostic #endif /* LIBC_SCCS and not lint */
2124191Skre 
2224191Skre char *
2324191Skre strpbrk(s, brk)
2424191Skre 	register char *s, *brk;
2524191Skre {
2624191Skre 	register char *p;
2724191Skre 	register c;
2824191Skre 
2924191Skre 	while (c = *s) {
3024191Skre 		for (p = brk; *p; p++)
3124191Skre 			if (c == *p)
3224191Skre 				return (s);
3324191Skre 		s++;
3424191Skre 	}
3524191Skre 	return (0);
3624191Skre }
37