From: GNU Libc Maintainers Date: Sat, 17 Sep 2016 18:00:44 +0000 (+0000) Subject: LC_COLLATE-keywords-ordering X-Git-Tag: archive/raspbian/2.25-3+rpi1~1^2^2^2^2^2^2^2^2^2^2^2^2~193 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d91d91821657d68a4f5126f2fd5791cf947e6561;p=glibc.git LC_COLLATE-keywords-ordering Be less strict about keywords ordering in LC_COLLATE section, to ease definition of new scripts. Submitted upstream: BZ690 # DP: Dpatch author: Denis Barbier # DP: Patch author: Denis Barbier # DP: Upstream status: BZ690 # DP: Date: 2006-01-08 Gbp-Pq: Topic locale Gbp-Pq: Name LC_COLLATE-keywords-ordering.diff --- diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c index f9a829c6e..72ad261f4 100644 --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c @@ -2753,14 +2753,23 @@ collate_read (struct linereader *ldfile, struct localedef_t *result, switch (nowtok) { case tok_copy: - /* Allow copying other locales. */ + /* 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; + } + now = lr_token (ldfile, charmap, result, NULL, verbose); if (now->tok != tok_string) goto err_label; - if (! ignore_content) - load_locale (LC_COLLATE, now->val.str.startmb, repertoire_name, - charmap, result); + if (state == 1 || state == 3 || state == 5) + goto err_label; + + load_locale (LC_COLLATE, now->val.str.startmb, repertoire_name, + charmap, result); lr_ignore_rest (ldfile, 1); break; @@ -2774,9 +2783,6 @@ collate_read (struct linereader *ldfile, struct localedef_t *result, break; } - if (state != 0) - goto err_label; - arg = lr_token (ldfile, charmap, result, NULL, verbose); if (arg->tok != tok_number) goto err_label; @@ -2797,7 +2803,7 @@ collate_read (struct linereader *ldfile, struct localedef_t *result, break; } - if (state != 0) + if (state == 1 || state == 3 || state == 5) goto err_label; arg = lr_token (ldfile, charmap, result, repertoire, verbose); @@ -2844,7 +2850,7 @@ collate_read (struct linereader *ldfile, struct localedef_t *result, break; } - if (state != 0 && state != 2) + if (state == 1 || state == 3 || state == 5) goto err_label; arg = lr_token (ldfile, charmap, result, repertoire, verbose); @@ -2910,7 +2916,7 @@ collate_read (struct linereader *ldfile, struct localedef_t *result, break; } - if (state != 0 && state != 2) + if (state == 1 || state == 3 || state == 5) goto err_label; arg = lr_token (ldfile, charmap, result, repertoire, verbose); @@ -3056,7 +3062,7 @@ collate_read (struct linereader *ldfile, struct localedef_t *result, break; } - if (state != 0) + if (state == 1 || state == 3 || state == 5) goto err_label; arg = lr_token (ldfile, charmap, result, repertoire, verbose); @@ -3177,7 +3183,7 @@ error while adding equivalent collating symbol")); break; } - if (state != 0 && state != 1 && state != 2) + if (state == 3 || state == 5) goto err_label; state = 1; @@ -3488,8 +3494,6 @@ error while adding equivalent collating symbol")); %s: missing `reorder-end' keyword"), "LC_COLLATE")); state = 4; } - else if (state != 2 && state != 4) - goto err_label; state = 5; /* Get the name of the sections we are adding after. */