124191Skre /* 224191Skre * Copyright (c) 1985 Regents of the University of California. 334479Sbostic * All rights reserved. 434479Sbostic * 542637Sbostic * %sccs.include.redist.c% 624191Skre */ 724191Skre 826535Sdonn #if defined(LIBC_SCCS) && !defined(lint) 9*46144Sbostic static char sccsid[] = "@(#)strpbrk.c 5.8 (Berkeley) 01/26/91"; 1034479Sbostic #endif /* LIBC_SCCS and not lint */ 1124191Skre 12*46144Sbostic #include <sys/cdefs.h> 1342169Sbostic #include <string.h> 1442169Sbostic 1542169Sbostic /* 1642169Sbostic * Find the first occurrence in s1 of a character in s2 (excluding NUL). 1742169Sbostic */ 1824191Skre char * 1937776Sbostic strpbrk(s1, s2) 2042169Sbostic register const char *s1, *s2; 2124191Skre { 2242169Sbostic register const char *scanp; 2337776Sbostic register int c, sc; 2424191Skre 2542169Sbostic while ((c = *s1++) != 0) { 2642169Sbostic for (scanp = s2; (sc = *scanp++) != 0;) 2737776Sbostic if (sc == c) 2842169Sbostic return ((char *)(s1 - 1)); 2942169Sbostic } 3042169Sbostic return (NULL); 3124191Skre } 32