r2371 - in glibc-package/branches/glibc-2.6/debian: . patches/locale
Author: madcoder
Date: 2007-06-17 18:34:52 +0000 (Sun, 17 Jun 2007)
New Revision: 2371
Modified:
glibc-package/branches/glibc-2.6/debian/changelog
glibc-package/branches/glibc-2.6/debian/patches/locale/preprocessor-collate.diff
Log:
proper patch for the locales, have the same limitation for define/undef than
for copy: it must be first.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Modified: glibc-package/branches/glibc-2.6/debian/changelog
===================================================================
--- glibc-package/branches/glibc-2.6/debian/changelog 2007-06-17 15:22:45 UTC (rev 2370)
+++ glibc-package/branches/glibc-2.6/debian/changelog 2007-06-17 18:34:52 UTC (rev 2371)
@@ -1,4 +1,4 @@
-glibc (2.6-0exp3) UNRELEASED; urgency=low
+glibc (2.6-0exp3) experimental; urgency=low
[ Pierre Habouzit ]
[ Clint Adams]
@@ -87,8 +87,10 @@
* kernelchecks.sh: add some quotes to unconfuse syntax hilighting a bit.
* nscd.init: ksh is confused if you call functions start or stop.
Closes: 428884.
+ * patches/locale/preprocessor-collate.diff: update it to work (with
+ restrictions) with depth >= 2 copies.
- -- Pierre Habouzit <madcoder@debian.org> Sun, 17 Jun 2007 14:15:39 +0100
+ -- Pierre Habouzit <madcoder@debian.org> Sun, 17 Jun 2007 17:18:49 +0100
glibc (2.5-11) UNRELEASED; urgency=low
Modified: glibc-package/branches/glibc-2.6/debian/patches/locale/preprocessor-collate.diff
===================================================================
--- glibc-package/branches/glibc-2.6/debian/patches/locale/preprocessor-collate.diff 2007-06-17 15:22:45 UTC (rev 2370)
+++ glibc-package/branches/glibc-2.6/debian/patches/locale/preprocessor-collate.diff 2007-06-17 18:34:52 UTC (rev 2371)
@@ -109,90 +109,101 @@
static void
collate_startup (struct linereader *ldfile, struct localedef_t *locale,
struct localedef_t *copy_locale, int ignore_content)
-@@ -3796,6 +3870,205 @@
- repertoire, result, nowtok);
- break;
+@@ -2613,6 +2687,7 @@
+ int ignore_content)
+ {
+ struct repertoire_t *repertoire = NULL;
++ struct toggle_list_t *defined_keywords = NULL;
+ struct locale_collate_t *collate;
+ struct token *now;
+ struct token *arg = NULL;
+@@ -2644,6 +2719,82 @@
+ }
+ while (nowtok == tok_eol);
-+ case tok_define:
-+ /* 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;
-+ }
++ while (nowtok == tok_define || nowtok == tok_undef)
++ {
++ /* Ignore the rest of the line if we don't need the input of
++ this line. */
++ if (ignore_content)
++ {
++ lr_ignore_rest (ldfile, 0);
++ now = lr_token (ldfile, charmap, result, NULL, verbose);
++ nowtok = now->tok;
++ continue;
++ }
+
-+ arg = lr_token (ldfile, charmap, result, NULL, verbose);
-+ if (arg->tok != tok_ident)
-+ goto err_label;
-+ else
-+ {
-+ struct toggle_list_t *runp = collate->defined_keywords;
-+ char *name;
++ arg = lr_token (ldfile, charmap, result, NULL, verbose);
++ if (arg->tok != tok_ident)
++ goto err_label;
+
-+ while (runp != NULL)
-+ if (strncmp (runp->name, arg->val.str.startmb,
-+ arg->val.str.lenmb) == 0
-+ && runp->name[arg->val.str.lenmb] == '\0')
-+ break;
-+ else
-+ runp = runp->last;
++ if (nowtok == tok_define)
++ {
++ struct toggle_list_t *runp = defined_keywords;
++ char *name;
+
-+ if (runp != NULL && runp->is_undefined == 0)
-+ {
-+ lr_ignore_rest (ldfile, 0);
-+ break;
-+ }
++ while (runp != NULL)
++ if (strncmp (runp->name, arg->val.str.startmb,
++ arg->val.str.lenmb) == 0
++ && runp->name[arg->val.str.lenmb] == '\0')
++ SYNTAX_ERROR (_("%s: syntax error"), "LC_COLLATE");
++ else
++ runp = runp->last;
+
-+ if (runp == NULL)
-+ {
-+ runp = (struct toggle_list_t *) xcalloc (1, sizeof (*runp));
-+ runp->last = collate->defined_keywords;
-+ collate->defined_keywords = runp;
-+ }
-+ else
-+ {
-+ free ((char *) runp->name);
-+ runp->is_undefined = 0;
-+ }
-+
-+ name = (char *) xmalloc (arg->val.str.lenmb + 1);
-+ memcpy (name, arg->val.str.startmb, arg->val.str.lenmb);
-+ name[arg->val.str.lenmb] = '\0';
-+ runp->name = name;
++ if (runp != NULL && runp->is_undefined == 0)
++ {
++ lr_ignore_rest (ldfile, 0);
++ SYNTAX_ERROR (_("%s: syntax error"), "LC_COLLATE");
+ }
-+ lr_ignore_rest (ldfile, 1);
-+ break;
+
-+ case tok_undef:
-+ /* Ignore the rest of the line if we don't need the input of
-+ this line. */
-+ if (ignore_content)
++ if (runp == NULL)
+ {
-+ lr_ignore_rest (ldfile, 0);
-+ break;
++ runp = (struct toggle_list_t *) xcalloc (1, sizeof (*runp));
++ runp->last = defined_keywords;
++ defined_keywords = runp;
+ }
-+
-+ arg = lr_token (ldfile, charmap, result, NULL, verbose);
-+ if (arg->tok != tok_ident)
-+ goto err_label;
+ else
+ {
-+ struct toggle_list_t *runp = collate->defined_keywords;
-+ while (runp != NULL)
-+ if (strncmp (runp->name, arg->val.str.startmb,
-+ arg->val.str.lenmb) == 0
-+ && runp->name[arg->val.str.lenmb] == '\0')
-+ {
-+ runp->is_undefined = 1;
-+ break;
-+ }
-+ else
-+ runp = runp->last;
++ free ((char *) runp->name);
++ runp->is_undefined = 0;
+ }
-+ lr_ignore_rest (ldfile, 1);
-+ break;
+
++ name = (char *) xmalloc (arg->val.str.lenmb + 1);
++ memcpy (name, arg->val.str.startmb, arg->val.str.lenmb);
++ name[arg->val.str.lenmb] = '\0';
++ runp->name = name;
++ }
++ else
++ {
++ struct toggle_list_t *runp = defined_keywords;
++ while (runp != NULL)
++ if (strncmp (runp->name, arg->val.str.startmb,
++ arg->val.str.lenmb) == 0
++ && runp->name[arg->val.str.lenmb] == '\0')
++ {
++ runp->is_undefined = 1;
++ SYNTAX_ERROR (_("%s: syntax error"), "LC_COLLATE");
++ }
++ else
++ runp = runp->last;
++ }
++
++ lr_ignore_rest (ldfile, 1);
++ do
++ {
++ now = lr_token (ldfile, charmap, result, NULL, verbose);
++ nowtok = now->tok;
++ }
++ while (nowtok == tok_eol);
++ }
++
+ if (nowtok == tok_copy)
+ {
+ state = 2;
+@@ -3796,6 +3947,125 @@
+ repertoire, result, nowtok);
+ break;
+
+ case tok_ifdef:
+ /* Ignore the rest of the line if we don't need the input of
+ this line. */
@@ -315,7 +326,7 @@
case tok_end:
/* Next we assume `LC_COLLATE'. */
if (!ignore_content)
-@@ -3825,6 +4098,13 @@
+@@ -3825,6 +4095,13 @@
else if (state == 5)
WITH_CUR_LOCALE (error (0, 0, _("\
%s: missing `reorder-sections-end' keyword"), "LC_COLLATE"));
Reply to: