xref: /csrg-svn/lib/libc/string/strpbrk.c (revision 34479)
124191Skre /*
224191Skre  * Copyright (c) 1985 Regents of the University of California.
3*34479Sbostic  * All rights reserved.
4*34479Sbostic  *
5*34479Sbostic  * Redistribution and use in source and binary forms are permitted
6*34479Sbostic  * provided that this notice is preserved and that due credit is given
7*34479Sbostic  * to the University of California at Berkeley. The name of the University
8*34479Sbostic  * may not be used to endorse or promote products derived from this
9*34479Sbostic  * software without specific written prior permission. This software
10*34479Sbostic  * is provided ``as is'' without express or implied warranty.
1124191Skre  */
1224191Skre 
1326535Sdonn #if defined(LIBC_SCCS) && !defined(lint)
14*34479Sbostic static char sccsid[] = "@(#)strpbrk.c	5.3 (Berkeley) 05/25/88";
15*34479Sbostic #endif /* LIBC_SCCS and not lint */
1624191Skre 
1724191Skre char *
1824191Skre strpbrk(s, brk)
1924191Skre 	register char *s, *brk;
2024191Skre {
2124191Skre 	register char *p;
2224191Skre 	register c;
2324191Skre 
2424191Skre 	while (c = *s) {
2524191Skre 		for (p = brk; *p; p++)
2624191Skre 			if (c == *p)
2724191Skre 				return (s);
2824191Skre 		s++;
2924191Skre 	}
3024191Skre 	return (0);
3124191Skre }
32