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 --- locale/programs/ld-collate.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c @@ -2750,14 +2750,23 @@ 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; @@ -2771,9 +2780,6 @@ break; } - if (state != 0) - goto err_label; - arg = lr_token (ldfile, charmap, result, NULL, verbose); if (arg->tok != tok_number) goto err_label; @@ -2794,7 +2800,7 @@ break; } - if (state != 0) + if (state == 1 || state == 3 || state == 5) goto err_label; arg = lr_token (ldfile, charmap, result, repertoire, verbose); @@ -2841,7 +2847,7 @@ break; } - if (state != 0 && state != 2) + if (state == 1 || state == 3 || state == 5) goto err_label; arg = lr_token (ldfile, charmap, result, repertoire, verbose); @@ -2907,7 +2913,7 @@ break; } - if (state != 0 && state != 2) + if (state == 1 || state == 3 || state == 5) goto err_label; arg = lr_token (ldfile, charmap, result, repertoire, verbose); @@ -3053,7 +3059,7 @@ break; } - if (state != 0) + if (state == 1 || state == 3 || state == 5) goto err_label; arg = lr_token (ldfile, charmap, result, repertoire, verbose); @@ -3174,7 +3180,7 @@ break; } - if (state != 0 && state != 1 && state != 2) + if (state == 3 || state == 5) goto err_label; state = 1; @@ -3484,8 +3490,6 @@ %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. */