Package: glibc / 2.24-11+deb9u4

locale/LC_COLLATE-keywords-ordering.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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
@@ -2749,14 +2749,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;
@@ -2770,9 +2779,6 @@
 	      break;
 	    }
 
-	  if (state != 0)
-	    goto err_label;
-
 	  arg = lr_token (ldfile, charmap, result, NULL, verbose);
 	  if (arg->tok != tok_number)
 	    goto err_label;
@@ -2793,7 +2799,7 @@
 	      break;
 	    }
 
-	  if (state != 0)
+	  if (state == 1 || state == 3 || state == 5)
 	    goto err_label;
 
 	  arg = lr_token (ldfile, charmap, result, repertoire, verbose);
@@ -2840,7 +2846,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);
@@ -2906,7 +2912,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);
@@ -3052,7 +3058,7 @@
 	      break;
 	    }
 
-	  if (state != 0)
+	  if (state == 1 || state == 3 || state == 5)
 	    goto err_label;
 
 	  arg = lr_token (ldfile, charmap, result, repertoire, verbose);
@@ -3173,7 +3179,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.  */