From af0172162f7c653cad6a11ed1c1a5459bc154465 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 14 Jan 2006 00:58:03 +0000 Subject: hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed --- libc/unistd/getsubopt.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libc/unistd/getsubopt.c') diff --git a/libc/unistd/getsubopt.c b/libc/unistd/getsubopt.c index bebfbc4ed..c6c078f6f 100644 --- a/libc/unistd/getsubopt.c +++ b/libc/unistd/getsubopt.c @@ -18,12 +18,13 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define memchr __memchr - +#define _GNU_SOURCE #include #include -extern char *__strchrnul(const char *s, int c); +libc_hidden_proto(memchr) +libc_hidden_proto(memcmp) +libc_hidden_proto(strchrnul) /* Parse comma separated suboption from *OPTIONP and match against strings in TOKENS. If found return index and set *VALUEP to @@ -40,7 +41,7 @@ int getsubopt(char **optionp, char *const *tokens, char **valuep) return -1; /* Find end of next token. */ - endp = __strchrnul (*optionp, ','); + endp = strchrnul (*optionp, ','); /* Find start of value. */ vstart = memchr (*optionp, '=', endp - *optionp); @@ -50,7 +51,7 @@ int getsubopt(char **optionp, char *const *tokens, char **valuep) /* Try to match the characters between *OPTIONP and VSTART against one of the TOKENS. */ for (cnt = 0; tokens[cnt] != NULL; ++cnt) - if (__memcmp (*optionp, tokens[cnt], vstart - *optionp) == 0 + if (memcmp (*optionp, tokens[cnt], vstart - *optionp) == 0 && tokens[cnt][vstart - *optionp] == '\0') { /* We found the current option in TOKENS. */ -- cgit v1.2.3