Check for unknown symbols in collation rules.  This is useful to
detect broken locales since unknown symbols are always wrong.

Original patch from belocs-locales-bin 2.3.4-3, 2005-03-30.  This
request has not been submitted upstream yet.

[[email protected], 2008-08-08: changed errors to warnings]

Signed-off-by: Jonathan Nieder <[email protected]>
---
 locale/programs/ld-collate.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index 11bd7ea..88b6890 100644
--- a/locale/programs/ld-collate.c
+++ b/locale/programs/ld-collate.c
@@ -3645,8 +3645,20 @@ error while adding equivalent collating symbol"));
            }
          else if (arg != NULL)
            {
+             void *ptr = NULL;
              symstr = arg->val.str.startmb;
              symlen = arg->val.str.lenmb;
+             if (state != 5
+                 && find_entry (&charmap->char_table, symstr, symlen, &ptr) != 0
+                 && (repertoire == NULL ||
+                     find_entry (&repertoire->char_table, symstr, symlen, 
&ptr) != 0)
+                 && find_entry (&collate->elem_table, symstr, symlen, &ptr) != 0
+                 && find_entry (&collate->sym_table, symstr, symlen, &ptr) != 
0)
+               {
+                 if (verbose)
+                   lr_error (ldfile, _("%s: symbol `%.*s' not known"),
+                             "LC_COLLATE", (int) symlen, symstr);
+               }
            }
          else
            {
-- 
1.7.5.1.668.gce6e7.dirty


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/20110510065916.GA2277@elie

Reply via email to