aboutsummaryrefslogtreecommitdiff
path: root/locale/programs/ld-collate.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-09-12 08:28:56 +0000
committerUlrich Drepper <drepper@redhat.com>1999-09-12 08:28:56 +0000
commitb9eb05d6bfd4c42c8ea614b77cbc50d95fee51d1 (patch)
tree7d42913f77a3db0fe5f54807a248578fe747e3d1 /locale/programs/ld-collate.c
parent0f0e233c0e6a7c3df341566bbbd60917439f9cc9 (diff)
downloadglibc-b9eb05d6bfd4c42c8ea614b77cbc50d95fee51d1.tar
glibc-b9eb05d6bfd4c42c8ea614b77cbc50d95fee51d1.tar.gz
glibc-b9eb05d6bfd4c42c8ea614b77cbc50d95fee51d1.tar.bz2
glibc-b9eb05d6bfd4c42c8ea614b77cbc50d95fee51d1.zip
Update.
1999-09-12 Ulrich Drepper <drepper@cygnus.com> * locale/programs/ld-address.c: Fix handling of non-existing definitions for this category. Correctly ignore content of this category is this is necessary. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/locfile.h (handle_copy): Take extra parameter with result pointer. Fill in name of locale from which to copy. Correctly read token after `END'. * locale/programs/localedef.c (main): Correct handling copy. (add_to_readlist): Take extra parameter which says whether we are supposed to read the file or not. (find_locale): Call add_to_readlist with extra parameter set to 0. * locale/programs/localedef.h (struct localedef_t): Use __LC_LAST instead of wrong number in array definitions. (add_to_readlist): Update prototype. * locale/programs/locfile.c (locfile_read): Mark categories not available in source file as read. (write_all_categories): Fix typo.
Diffstat (limited to 'locale/programs/ld-collate.c')
-rw-r--r--locale/programs/ld-collate.c122
1 files changed, 110 insertions, 12 deletions
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index 3c1267420c..20a8776f93 100644
--- a/locale/programs/ld-collate.c
+++ b/locale/programs/ld-collate.c
@@ -601,6 +601,14 @@ collate_read (struct linereader *ldfile, struct localedef_t *result,
switch (nowtok)
{
case tok_coll_weight_max:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
+ if (ignore_content)
+ {
+ lr_ignore_rest (ldfile, 0);
+ break;
+ }
+
if (state != 0)
goto err_label;
@@ -616,6 +624,14 @@ collate_read (struct linereader *ldfile, struct localedef_t *result,
break;
case tok_section_symbol:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
+ if (ignore_content)
+ {
+ lr_ignore_rest (ldfile, 0);
+ break;
+ }
+
if (state != 0)
goto err_label;
@@ -652,6 +668,14 @@ collate_read (struct linereader *ldfile, struct localedef_t *result,
break;
case tok_collating_element:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
+ if (ignore_content)
+ {
+ lr_ignore_rest (ldfile, 0);
+ break;
+ }
+
if (state != 0)
goto err_label;
@@ -732,6 +756,14 @@ error while adding collating element"));
break;
case tok_collating_symbol:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
+ if (ignore_content)
+ {
+ lr_ignore_rest (ldfile, 0);
+ break;
+ }
+
if (state != 0)
goto err_label;
@@ -774,6 +806,14 @@ error while adding collating symbol"));
break;
case tok_symbol_equivalence:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
+ if (ignore_content)
+ {
+ lr_ignore_rest (ldfile, 0);
+ break;
+ }
+
if (state != 0)
goto err_label;
@@ -853,6 +893,14 @@ error while adding equivalent collating symbol"));
break;
case tok_order_start:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
+ if (ignore_content)
+ {
+ lr_ignore_rest (ldfile, 0);
+ break;
+ }
+
if (state != 0 && state != 1)
goto err_label;
state = 1;
@@ -933,6 +981,14 @@ error while adding equivalent collating symbol"));
break;
case tok_order_end:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
+ if (ignore_content)
+ {
+ lr_ignore_rest (ldfile, 0);
+ break;
+ }
+
if (state != 1)
goto err_label;
state = 2;
@@ -940,6 +996,14 @@ error while adding equivalent collating symbol"));
break;
case tok_reorder_after:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
+ if (ignore_content)
+ {
+ lr_ignore_rest (ldfile, 0);
+ break;
+ }
+
if (state != 2 && state != 3)
goto err_label;
state = 3;
@@ -947,6 +1011,11 @@ error while adding equivalent collating symbol"));
break;
case tok_reorder_end:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
+ if (ignore_content)
+ break;
+
if (state != 3)
goto err_label;
state = 4;
@@ -954,6 +1023,14 @@ error while adding equivalent collating symbol"));
break;
case tok_bsymbol:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
+ if (ignore_content)
+ {
+ lr_ignore_rest (ldfile, 0);
+ break;
+ }
+
if (state != 1 && state != 3)
goto err_label;
@@ -996,12 +1073,28 @@ error while adding equivalent collating symbol"));
break;
case tok_undefined:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
+ if (ignore_content)
+ {
+ lr_ignore_rest (ldfile, 0);
+ break;
+ }
+
if (state != 1)
goto err_label;
/* XXX handle UNDEFINED weight */
break;
case tok_ellipsis3:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
+ if (ignore_content)
+ {
+ lr_ignore_rest (ldfile, 0);
+ break;
+ }
+
if (state != 1 && state != 3)
goto err_label;
@@ -1012,16 +1105,21 @@ error while adding equivalent collating symbol"));
case tok_end:
/* Next we assume `LC_COLLATE'. */
- if (state == 0)
- /* We must either see a copy statement or have ordering values. */
- lr_error (ldfile, _("%s: empty category description not allowed"),
- "LC_COLLATE");
- else if (state == 1)
- lr_error (ldfile, _("%s: missing `order_end' keyword"),
- "LC_COLLATE");
- else if (state == 3)
- error (0, 0, _("%s: missing `reorder-end' keyword"),
- "LC_COLLATE");
+ if (!ignore_content)
+ {
+ if (state == 0)
+ /* We must either see a copy statement or have
+ ordering values. */
+ lr_error (ldfile,
+ _("%s: empty category description not allowed"),
+ "LC_COLLATE");
+ else if (state == 1)
+ lr_error (ldfile, _("%s: missing `order_end' keyword"),
+ "LC_COLLATE");
+ else if (state == 3)
+ error (0, 0, _("%s: missing `reorder-end' keyword"),
+ "LC_COLLATE");
+ }
arg = lr_token (ldfile, charmap, NULL);
if (arg->tok == tok_eof)
break;
@@ -3007,8 +3105,8 @@ read_lc_collate (struct linereader *ldfile, struct localedef_t *result,
/* If we see `copy' now we are almost done. */
if (nowtok == tok_copy)
{
- handle_copy (ldfile, charmap, tok_lc_collate, LC_COLLATE, "LC_COLLATE",
- ignore_content);
+ handle_copy (ldfile, charmap, repertoire, result, tok_lc_collate,
+ LC_COLLATE, "LC_COLLATE", ignore_content);
did_copy = 1;
}