This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[Rafal Dabrowa <rafal@softsystem.com.pl>] libc/1163: glibc: wrong work of strcoll



What's broken here (i486, glibc 2.1.1)?

Without any locale information:
$  ./strcoll-test a B; ./strcoll-test B b
strcoll( a, B ) = 31
strcoll( B, b ) = -32

with LANG=de_DE (locale is installed)
$ LANG=de_DE ./strcoll-test a B; LANG=de_DE ./strcoll-test B b 
strcoll( a, B ) = -1
strcoll( B, b ) = 1

with LANG=pl_PL (generated with: localedef -i pl_PL -f ISO-8859-2 pl_PL)
$ LANG=pl_PL ./strcoll-test a B; LANG=pl_PL ./strcoll-test B b
strcoll( a, B ) = -1
strcoll( B, b ) = 1

Andreas



Topics:
   libc/1163: glibc: wrong work of strcoll


----------------------------------------------------------------------

Date: Tue, 15 Jun 1999 08:56:05 +0200 (DFT)
From: Rafal Dabrowa <rafal@softsystem.com.pl>
To: bugs@gnu.org
Subject: libc/1163: glibc: wrong work of strcoll
Message-Id: <199906150656.IAA36270@waw.softsystem.com.pl.>


>Number:         1163
>Category:       libc
>Synopsis:       glibc: wrong work of strcoll
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    libc-gnats
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Tue Jun 15 03:00:01 EDT 1999
>Last-Modified:
>Originator:     rafal
>Organization:
 
>Release:        libc-2.1.1
>Environment:
	
Host type: i386-redhat-linux-gnu
System: Linux localhost 2.2.9 #1 pon cze 14 13:43:09 CEST 1999 i586 unknown
Architecture: i586

Addons: crypt glibc-compat linuxthreads
Build CFLAGS: -g -O3
Build CC: egcs
Compiler version: egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
Kernel headers: 2.2.9
Symbol versioning: yes
Build static: yes
Build shared: yes
Build pic-default: no
Build profile: yes
Build omitfp: no
Build bounded: no
Build static-nss: no
Stdio: libio

>Description:
	after call setlocale(LC_ALL, ""), function strcoll
	produces wrong results. e.g.:
	strcoll( "a", "B" ) = -1		(should be greater than 0)
	strcoll( "B", "b" ) = 1			(should be less than 0)
>How-To-Repeat:
	please compile program below:

		#include <stdio.h>
		#include <string.h>
		#include <locale.h>

		int main( int argc, char *argv[])
		{
			setlocale(LC_ALL, "" );
			printf( "strcoll( %s, %s ) = %d\n",
				argv[1], argv[2], strcoll(argv[1], argv[2]) );
			return 0;
		}
	and run it - e.g.:
		a.out a B
		a.out B b
	I have set LANG to "pl" and LC_ALL to "pl_PL"; but I checked it also
	with LANG set to "en" and LC_ALL equal "en_US" - there are similar errors.
>Fix:
	;-(
>Audit-Trail:
>Unformatted:


------------------------------

End of forwarddPGvah Digest
***************************



-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]