Mercurial > gnulib
annotate lib/strpbrk.c @ 40186:8964917f9574
autoupdate
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Mon, 18 Feb 2019 08:02:49 -0800 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
39891
diff
changeset
|
1 /* Copyright (C) 1991, 1994, 2000, 2002-2003, 2006, 2009-2019 Free Software |
7302
8a1a9361108c
* _fpending.c: Include <config.h> unconditionally, since we no
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
2 Foundation, Inc. |
8a1a9361108c
* _fpending.c: Include <config.h> unconditionally, since we no
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
3 |
494 | 4 NOTE: The canonical source of this file is maintained with the GNU C Library. |
5 Bugs can be reported to bug-glibc@prep.ai.mit.edu. | |
493 | 6 |
494 | 7 This program is free software; you can redistribute it and/or modify it |
8 under the terms of the GNU General Public License as published by the | |
9 Free Software Foundation; either version 2, or (at your option) any | |
10 later version. | |
493 | 11 |
494 | 12 This program is distributed in the hope that it will be useful, |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 GNU General Public License for more details. | |
493 | 16 |
494 | 17 You should have received a copy of the GNU General Public License |
19190 | 18 along with this program; if not, see <https://www.gnu.org/licenses/>. */ |
493 | 19 |
7302
8a1a9361108c
* _fpending.c: Include <config.h> unconditionally, since we no
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
20 #include <config.h> |
493 | 21 |
3975
e34e6bd35c66
Minimize diffs to glibc. Modernize.
Bruno Haible <bruno@clisp.org>
parents:
2089
diff
changeset
|
22 #include <stddef.h> |
4682 | 23 #include <string.h> |
3975
e34e6bd35c66
Minimize diffs to glibc. Modernize.
Bruno Haible <bruno@clisp.org>
parents:
2089
diff
changeset
|
24 |
39891
ecf9a91cdbcb
strpbrk: Make it possible to namespace the defined symbol.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
25 #if _LIBC |
ecf9a91cdbcb
strpbrk: Make it possible to namespace the defined symbol.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
26 # undef strpbrk |
ecf9a91cdbcb
strpbrk: Make it possible to namespace the defined symbol.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
27 #endif |
3975
e34e6bd35c66
Minimize diffs to glibc. Modernize.
Bruno Haible <bruno@clisp.org>
parents:
2089
diff
changeset
|
28 |
e34e6bd35c66
Minimize diffs to glibc. Modernize.
Bruno Haible <bruno@clisp.org>
parents:
2089
diff
changeset
|
29 /* Find the first occurrence in S of any character in ACCEPT. */ |
493 | 30 char * |
2089 | 31 strpbrk (const char *s, const char *accept) |
493 | 32 { |
33 while (*s != '\0') | |
34 { | |
35 const char *a = accept; | |
36 while (*a != '\0') | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
7302
diff
changeset
|
37 if (*a++ == *s) |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
7302
diff
changeset
|
38 return (char *) s; |
493 | 39 ++s; |
40 } | |
41 | |
3975
e34e6bd35c66
Minimize diffs to glibc. Modernize.
Bruno Haible <bruno@clisp.org>
parents:
2089
diff
changeset
|
42 return NULL; |
493 | 43 } |