From: GNU Libc Maintainers Date: Sun, 14 Jan 2018 10:24:48 +0000 (+0000) Subject: LC_COLLATE-keywords-ordering X-Git-Tag: archive/raspbian/2.26-4+rpi1^2~216 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9b3c959c93c1ba322d04eb8c45bafee5ac6636bc;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 a6b7e7320..e5d0abf31 100644 --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c @@ -2742,14 +2742,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; @@ -2763,9 +2772,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; @@ -2786,7 +2792,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); @@ -2833,7 +2839,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); @@ -2899,7 +2905,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); @@ -3045,7 +3051,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); @@ -3166,7 +3172,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; @@ -3474,8 +3480,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. */