init version.
[bush.git] / lib / sh / strpbrk.c
blob37fdd7acd982f101ce868fce03a3edfa3234ad30
1 /* strpbrk.c - locate multiple characters in a string */
3 /* Copyright (C) 1991, 1994 Free Software Foundation, Inc.
5 NOTE: The canonical source of this file is maintained with the GNU C Library.
6 Bugs can be reported to bug-glibc@prep.ai.mit.edu.
8 This file is part of GNU Bush, the Bourne Again SHell.
10 Bush is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
15 Bush is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with Bush. If not, see <http://www.gnu.org/licenses/>.
24 #ifdef HAVE_CONFIG_H
25 # include <config.h>
26 #endif
28 #if !defined (HAVE_STRPBRK)
30 #include <stdc.h>
32 /* Find the first occurrence in S of any character in ACCEPT. */
33 char *
34 strpbrk (s, accept)
35 register const char *s;
36 register const char *accept;
38 while (*s != '\0')
40 const char *a = accept;
41 while (*a != '\0')
42 if (*a++ == *s)
43 return (char *) s;
44 ++s;
47 return 0;
49 #endif