From c093ea4f4c9ef460b864f3cf8ef6665ce74ecc4a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 24 Sep 2005 16:37:16 +0000 Subject: * locale/programs/ld-address.c (address_finish): Produce better error messages for invalid lang_ab use. --- locale/programs/ld-address.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'locale') diff --git a/locale/programs/ld-address.c b/locale/programs/ld-address.c index 079aa0094d..5a7d821de6 100644 --- a/locale/programs/ld-address.c +++ b/locale/programs/ld-address.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1998-2002, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. @@ -224,17 +224,24 @@ No definition for %s category found"), "LC_ADDRESS")); if (address->lang_ab == NULL) { - if (verbose && ! nothing) + if (iso639[cnt].ab[0] != '\0' && verbose && ! nothing) WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"), "LC_ADDRESS", "lang_ab")); address->lang_ab = ""; } else if (address->lang_ab[0] == '\0') { - if (verbose) + if (iso639[cnt].ab[0] != '\0' && verbose) WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' must not be empty"), "LC_ADDRESS", "lang_ab")); } + else if (iso639[cnt].ab[0] == '\0') + { + WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' must not be defined"), + "LC_ADDRESS", "lang_ab")); + + address->lang_ab = ""; + } else { if (cnt == sizeof (iso639) / sizeof (iso639[0])) -- cgit v1.2.3