+2007-10-02 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #645]
+ * locale/programs/ld-collate.c (collate_finish): Compare against last
+ used section which is known to have rules defined.
+ (collate_read): After order_start, correctly record order of sections
+ and queue sections up.
+
2007-10-01 Ulrich Drepper <drepper@redhat.com>
[BZ #5071]
or in none. */
for (i = 0; i < nrules; ++i)
for (sect = collate->sections; sect != NULL; sect = sect->next)
- if (sect->rules != NULL
+ if (sect != collate->current_section
+ && sect->rules != NULL
&& ((sect->rules[i] & sort_position)
- != (collate->sections->rules[i] & sort_position)))
+ != (collate->current_section->rules[i] & sort_position)))
{
WITH_CUR_LOCALE (error (0, 0, _("\
%s: `position' must be used for a specific level in all sections or none"),
{
/* Insert sp in the collate->sections list,
right after collate->current_section. */
- if (collate->current_section == NULL)
- collate->current_section = sp;
- else
+ if (collate->current_section != NULL)
{
sp->next = collate->current_section->next;
collate->current_section->next = sp;
}
+ else if (collate->sections == NULL)
+ /* This is the first section to be defined. */
+ collate->sections = sp;
+
+ collate->current_section = sp;
}
/* Next should come the end of the line or a semicolon. */