diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-07-30 22:24:49 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-07-30 22:24:49 +0000 |
commit | c10d32c83429239be3c7d7159aa0e558f6e97bcc (patch) | |
tree | 684aed5af9b37435a0bb87db645c6f2c92ff6ff4 /locale/programs | |
parent | d5ba53f90790e2c3e9c95e39db32067d7e25b34e (diff) | |
download | glibc-c10d32c83429239be3c7d7159aa0e558f6e97bcc.tar.gz glibc-c10d32c83429239be3c7d7159aa0e558f6e97bcc.tar.xz glibc-c10d32c83429239be3c7d7159aa0e558f6e97bcc.zip |
* locale/programs/localedef.c (add_to_readlist): Rename local
variables to avoid confusion. * locale/programs/charmap.c (charmap_read): Emit error message if charmap couldn't be found or read.
Diffstat (limited to 'locale/programs')
-rw-r--r-- | locale/programs/charmap.c | 10 | ||||
-rw-r--r-- | locale/programs/localedef.c | 26 |
2 files changed, 17 insertions, 19 deletions
diff --git a/locale/programs/charmap.c b/locale/programs/charmap.c index 6ac898d161..e56b0be81c 100644 --- a/locale/programs/charmap.c +++ b/locale/programs/charmap.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1998-2004,2005 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1998-2004,2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gnu.org>, 1996. @@ -130,13 +130,11 @@ charmap_read (const char *filename, int verbose, int be_quiet, int use_default) } if (cmfile != NULL) - { - result = parse_charmap (cmfile, verbose, be_quiet); + result = parse_charmap (cmfile, verbose, be_quiet); - if (result == NULL && !be_quiet) - WITH_CUR_LOCALE (error (0, errno, _("\ + if (result == NULL && !be_quiet) + WITH_CUR_LOCALE (error (0, errno, _("\ character map file `%s' not found"), filename)); - } } if (result == NULL && filename != NULL && strchr (filename, '/') == NULL) diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c index 645a803c06..f705f34a75 100644 --- a/locale/programs/localedef.c +++ b/locale/programs/localedef.c @@ -530,7 +530,7 @@ normalize_codeset (codeset, name_len) struct localedef_t * -add_to_readlist (int locale, const char *name, const char *repertoire_name, +add_to_readlist (int category, const char *name, const char *repertoire_name, int generate, struct localedef_t *copy_locale) { struct localedef_t *runp = locales; @@ -561,39 +561,39 @@ add_to_readlist (int locale, const char *name, const char *repertoire_name, } if (generate - && (runp->needed & (1 << locale)) != 0 - && (runp->avail & (1 << locale)) == 0) + && (runp->needed & (1 << category)) != 0 + && (runp->avail & (1 << category)) == 0) WITH_CUR_LOCALE (error (5, 0, _("\ circular dependencies between locale definitions"))); if (copy_locale != NULL) { - if (runp->categories[locale].generic != NULL) + if (runp->categories[category].generic != NULL) WITH_CUR_LOCALE (error (5, 0, _("\ cannot add already read locale `%s' a second time"), name)); else - runp->categories[locale].generic = - copy_locale->categories[locale].generic; + runp->categories[category].generic = + copy_locale->categories[category].generic; } - runp->needed |= 1 << locale; + runp->needed |= 1 << category; return runp; } struct localedef_t * -find_locale (int locale, const char *name, const char *repertoire_name, +find_locale (int category, const char *name, const char *repertoire_name, const struct charmap_t *charmap) { struct localedef_t *result; /* Find the locale, but do not generate it since this would be a bug. */ - result = add_to_readlist (locale, name, repertoire_name, 0, NULL); + result = add_to_readlist (category, name, repertoire_name, 0, NULL); assert (result != NULL); - if ((result->avail & (1 << locale)) == 0 + if ((result->avail & (1 << category)) == 0 && locfile_read (result, charmap) != 0) WITH_CUR_LOCALE (error (4, errno, _("\ cannot open locale definition file `%s'"), result->name)); @@ -603,17 +603,17 @@ cannot open locale definition file `%s'"), result->name)); struct localedef_t * -load_locale (int locale, const char *name, const char *repertoire_name, +load_locale (int category, const char *name, const char *repertoire_name, const struct charmap_t *charmap, struct localedef_t *copy_locale) { struct localedef_t *result; /* Generate the locale if it does not exist. */ - result = add_to_readlist (locale, name, repertoire_name, 1, copy_locale); + result = add_to_readlist (category, name, repertoire_name, 1, copy_locale); assert (result != NULL); - if ((result->avail & (1 << locale)) == 0 + if ((result->avail & (1 << category)) == 0 && locfile_read (result, charmap) != 0) WITH_CUR_LOCALE (error (4, errno, _("\ cannot open locale definition file `%s'"), result->name)); |