A bug in ld-collate.c

Yong Li yong.li@asu.edu
Wed Jul 19 15:42:00 GMT 2000


Hi,

When using symbolic ellipsis in collating statement, such as
     startchar
     ..
     endchar
localedef complains that all the characters expended from the ellipsis
except the first one are already defined, despite they are not. I traced
the problem into "handle_ellipsis" function in ld-collate.c file. Please
look at the following 4 lines of code (Line#1263-1267 in ld-collate.c in
glibc-2.1.91 release):

	/* Generate the the name.  */
	sprintf (buf + preflen, base == 10 ? "%d" : "%x", from);

	/* Look whether this name is already defined.  */
	if (find_entry (&collate->seq_table, symstr, symlen,
	                                     ^^^^^^

I believe that "symstr" in the last line should be "buf" instead. It
meant to check the newly generated name, not "symstr" which always
points to the name of endchar and this name was already inserted into
the hash table before the loop.

Yong Li



More information about the Libc-alpha mailing list