summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-09-28 10:35:41 -0700
committerUlrich Drepper <drepper@redhat.com>2009-09-28 10:35:41 -0700
commit9d076f21cdf5f7bb2293498ed22330bb02c0a68d (patch)
tree353aeb07a2b6c59bc562951fbd9cc13fec553842
parentf450806e22be467a8d613f9a811508ccb87a5d1a (diff)
downloadglibc-9d076f21cdf5f7bb2293498ed22330bb02c0a68d.tar.gz
glibc-9d076f21cdf5f7bb2293498ed22330bb02c0a68d.tar.xz
glibc-9d076f21cdf5f7bb2293498ed22330bb02c0a68d.zip
Fix locale program error handling
If an unknown name is passed to locale, report it and fail.
-rw-r--r--ChangeLog5
-rw-r--r--locale/programs/locale-spec.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 25093e47c9..25c528e462 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-28  Ulrich Drepper  <drepper@redhat.com>
+
+	* locale/programs/locale-spec.c (locale_special): If nothing matches
+	fail with an appropriate message.
+
 2009-09-10  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* configure.in: Exclude binutils 2.X.  Support binutils 2.100
diff --git a/locale/programs/locale-spec.c b/locale/programs/locale-spec.c
index 6334f4c5ff..63a7a32e05 100644
--- a/locale/programs/locale-spec.c
+++ b/locale/programs/locale-spec.c
@@ -1,5 +1,5 @@
 /* Handle special requests.
-   Copyright (C) 1996, 1997, 1999, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1999, 2005, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
 
@@ -124,4 +124,7 @@ locale_special (const char *name, int show_category_name,
       return;
     }
 #endif
+
+  /* If nothing matches, fail.  */
+  error (1, 0, gettext ("unknown name \"%s\""), name);
 }