diff options
Diffstat (limited to 'intl/explodename.c')
-rw-r--r-- | intl/explodename.c | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/intl/explodename.c b/intl/explodename.c index 31fcf3ddfa..9e049c7be6 100644 --- a/intl/explodename.c +++ b/intl/explodename.c @@ -1,20 +1,18 @@ /* Copyright (C) 1995-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. - The GNU C Library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -37,11 +35,13 @@ /* @@ end of prolog @@ */ -static char *_nl_find_language PARAMS ((const char *name)); +/* Split a locale name NAME into a leading language part and all the + rest. Return a pointer to the first character after the language, + i.e. to the first byte of the rest. */ +static char *_nl_find_language (const char *name); static char * -_nl_find_language (name) - const char *name; +_nl_find_language (const char *name) { while (name[0] != '\0' && name[0] != '_' && name[0] != '@' && name[0] != '.') ++name; @@ -51,14 +51,10 @@ _nl_find_language (name) int -_nl_explode_name (name, language, modifier, territory, codeset, - normalized_codeset) - char *name; - const char **language; - const char **modifier; - const char **territory; - const char **codeset; - const char **normalized_codeset; +_nl_explode_name (char *name, + const char **language, const char **modifier, + const char **territory, const char **codeset, + const char **normalized_codeset) { char *cp; int mask; @@ -77,8 +73,8 @@ _nl_explode_name (name, language, modifier, territory, codeset, if (*language == cp) /* This does not make sense: language has to be specified. Use this entry as it is without exploding. Perhaps it is an alias. */ - cp = __rawmemchr (*language, '\0'); - else if (cp[0] != '@') + cp = strchr (*language, '\0'); + else { if (cp[0] == '_') { |