-/* Copyright (C) 1995-2003, 2005-2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2003, 2005-2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
struct section_list *current_section;
/* There always can be an unnamed section. */
struct section_list unnamed_section;
+ /* Flag whether the unnamed section has been defined. */
+ bool unnamed_section_defined;
/* To make handling of errors easier we have another section. */
struct section_list error_section;
/* Sometimes we are defining the values for collating symbols before
if (find_entry (&collate->seq_table, str, len, &result) != 0)
{
/* Nope, not define yet. So we see whether it is a
- collation symbol. */
+ collation symbol. */
void *ptr;
if (find_entry (&collate->sym_table, str, len, &ptr) == 0)
if (*cp == '<')
{
/* Ahh, it's a bsymbol or an UCS4 value. If it's
- the latter we have to unify the name. */
+ the latter we have to unify the name. */
const char *startp = ++cp;
size_t len;
else
{
/* Determine the range. To do so we have to determine the
- common prefix of the both names and then the numeric
- values of both ends. */
+ common prefix of the both names and then the numeric
+ values of both ends. */
size_t lenfrom = strlen (startp->name);
size_t lento = strlen (endp->name);
char buf[lento + 1];
else
{
/* The entries in the list are sorted by length and then
- alphabetically. This is the order in which we will add the
- elements to the collation table. This allows simply walking
+ alphabetically. This is the order in which we will add the
+ elements to the collation table. This allows simply walking
the table in sequence and stopping at the first matching
- entry. Since the longer sequences are coming first in the
- list they have the possibility to match first, just as it
- has to be. In the worst case we are walking to the end of
- the list where we put, if no singlebyte sequence is defined
- in the locale definition, the weights for UNDEFINED.
+ entry. Since the longer sequences are coming first in the
+ list they have the possibility to match first, just as it
+ has to be. In the worst case we are walking to the end of
+ the list where we put, if no singlebyte sequence is defined
+ in the locale definition, the weights for UNDEFINED.
To reduce the length of the search list we compress them a bit.
This happens by collecting sequences of consecutive byte
obstack_1grow_fast (&extrapool, curp->mbs[i]);
/* Now find the end of the consecutive sequence and
- add all the indeces in the indirect pool. */
+ add all the indeces in the indirect pool. */
do
{
weightidx = output_weight (&weightpool, collate, curp);
obstack_int32_grow (&indirectpool, weightidx);
/* And add the end byte sequence. Without length this
- time. */
+ time. */
for (i = 1; i < curp->nmbs; ++i)
obstack_1grow_fast (&extrapool, curp->mbs[i]);
}
& (__alignof__ (int32_t) - 1)) == 0);
/* If the final entry in the list is not a single character we
- add an UNDEFINED entry here. */
+ add an UNDEFINED entry here. */
if (lastp->nmbs != 1)
{
int added = ((sizeof (int32_t) + 1 + 1 + __alignof__ (int32_t) - 1)
else
{
/* One should not be allowed to open the same
- section twice. */
+ section twice. */
if (sp->first != NULL)
lr_error (ldfile, _("\
%s: multiple order definitions for section `%s'"),
section. */
collate->current_section = &collate->unnamed_section;
- if (collate->unnamed_section.first != NULL)
+ if (collate->unnamed_section_defined)
lr_error (ldfile, _("\
%s: multiple order definitions for unnamed section"),
"LC_COLLATE");
the collate->sections list. */
collate->unnamed_section.next = collate->sections;
collate->sections = &collate->unnamed_section;
+ collate->unnamed_section_defined = true;
}
}
else
{
/* This is bad. The section after which we have to
- reorder does not exist. Therefore we cannot
- process the whole rest of this reorder
- specification. */
+ reorder does not exist. Therefore we cannot
+ process the whole rest of this reorder
+ specification. */
lr_error (ldfile, _("%s: section `%.*s' not known"),
"LC_COLLATE", (int) arg->val.str.lenmb,
arg->val.str.startmb);
if (state == 0)
{
/* We are outside an `order_start' region. This means
- we must only accept definitions of values for
- collation symbols since these are purely abstract
- values and don't need directions associated. */
+ we must only accept definitions of values for
+ collation symbols since these are purely abstract
+ values and don't need directions associated. */
void *ptr;
if (find_entry (&collate->seq_table, symstr, symlen, &ptr) == 0)
seqp->next->last = seqp->last;
/* We also have to check whether this entry is the
- first or last of a section. */
+ first or last of a section. */
if (seqp->section->first == seqp)
{
if (seqp->section->first == seqp->section->last)
}
/* Process the rest of the line which might change
- the collation rules. */
+ the collation rules. */
arg = lr_token (ldfile, charmap, result, repertoire,
verbose);
if (arg->tok != tok_eof && arg->tok != tok_eol)
else if (was_ellipsis != tok_none)
{
/* Using the information in the `ellipsis_weight'
- element and this and the last value we have to handle
- the ellipsis now. */
+ element and this and the last value we have to handle
+ the ellipsis now. */
assert (state == 1);
handle_ellipsis (ldfile, symstr, symlen, was_ellipsis, charmap,
case tok_ellipsis3: /* absolute ellipsis */
case tok_ellipsis4: /* symbolic decimal ellipsis */
/* This is the symbolic (decimal or hexadecimal) or absolute
- ellipsis. */
+ ellipsis. */
if (was_ellipsis != tok_none)
goto err_label;