Mercurial > hg > octave-kai > gnulib-hg
annotate lib/strpbrk.c @ 5940:5e3f37f5f1d4
2005-06-25 Simon Josefsson <jas@extundo.com>
* modules/check-version: New file.
author | Simon Josefsson <simon@josefsson.org> |
---|---|
date | Tue, 28 Jun 2005 09:50:35 +0000 |
parents | a48fb0e98c8c |
children | 8a1a9361108c |
rev | line source |
---|---|
4682 | 1 /* Copyright (C) 1991, 1994, 2000, 2002-2003 Free Software Foundation, Inc. |
494 | 2 NOTE: The canonical source of this file is maintained with the GNU C Library. |
3 Bugs can be reported to bug-glibc@prep.ai.mit.edu. | |
493 | 4 |
494 | 5 This program is free software; you can redistribute it and/or modify it |
6 under the terms of the GNU General Public License as published by the | |
7 Free Software Foundation; either version 2, or (at your option) any | |
8 later version. | |
493 | 9 |
494 | 10 This program is distributed in the hope that it will be useful, |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 GNU General Public License for more details. | |
493 | 14 |
494 | 15 You should have received a copy of the GNU General Public License |
649
89f4c1937ac7
update FSF address in copyright and remove any trailing blanks
Jim Meyering <jim@meyering.net>
parents:
494
diff
changeset
|
16 along with this program; if not, write to the Free Software Foundation, |
5848
a48fb0e98c8c
*** empty log message ***
Paul Eggert <eggert@cs.ucla.edu>
parents:
4682
diff
changeset
|
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ |
493 | 18 |
3975
e34e6bd35c66
Minimize diffs to glibc. Modernize.
Bruno Haible <bruno@clisp.org>
parents:
2089
diff
changeset
|
19 #ifdef HAVE_CONFIG_H |
494 | 20 # include <config.h> |
21 #endif | |
493 | 22 |
3975
e34e6bd35c66
Minimize diffs to glibc. Modernize.
Bruno Haible <bruno@clisp.org>
parents:
2089
diff
changeset
|
23 #include <stddef.h> |
4682 | 24 #include <string.h> |
3975
e34e6bd35c66
Minimize diffs to glibc. Modernize.
Bruno Haible <bruno@clisp.org>
parents:
2089
diff
changeset
|
25 |
e34e6bd35c66
Minimize diffs to glibc. Modernize.
Bruno Haible <bruno@clisp.org>
parents:
2089
diff
changeset
|
26 #undef strpbrk |
e34e6bd35c66
Minimize diffs to glibc. Modernize.
Bruno Haible <bruno@clisp.org>
parents:
2089
diff
changeset
|
27 |
e34e6bd35c66
Minimize diffs to glibc. Modernize.
Bruno Haible <bruno@clisp.org>
parents:
2089
diff
changeset
|
28 /* Find the first occurrence in S of any character in ACCEPT. */ |
493 | 29 char * |
2089 | 30 strpbrk (const char *s, const char *accept) |
493 | 31 { |
32 while (*s != '\0') | |
33 { | |
34 const char *a = accept; | |
35 while (*a != '\0') | |
36 if (*a++ == *s) | |
37 return (char *) s; | |
38 ++s; | |
39 } | |
40 | |
3975
e34e6bd35c66
Minimize diffs to glibc. Modernize.
Bruno Haible <bruno@clisp.org>
parents:
2089
diff
changeset
|
41 return NULL; |
493 | 42 } |