This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: B19, EGCS 1.1: Strcasecmp uses uppercase?
- To: Steven van Dijk <steven at cs dot uu dot nl>
- Subject: Re: B19, EGCS 1.1: Strcasecmp uses uppercase?
- From: Mumit Khan <khan at xraylith dot wisc dot edu>
- Date: Fri, 27 Nov 1998 14:53:13 -0600
- cc: gnu-win32 at cygnus dot com
Steven van Dijk <steven@cs.uu.nl> writes:
>
> #include <stdio.h>
> #include <string.h>
>
> main()
> {
> char * s1 = "String";
> char * s2 = "S_";
>
> printf("Comparing s1 with s2 returns: %d\n", strcasecmp(s1,s2));
> }
>
> On my system (using b19, no patches and EGCS 1.1) I get:
> Comparing s1 with s2 returns: -11
>
> and on the Unix system I get:
> Comparing s1 with s2 returns: 21
This is a bug in newlib string handling routines. I'll submit a patch to
the cygwin folks.
Thanks for pointing it out with a test case. There is a workaround until
the patch makes it in -- always specify the *longer* string as the *second*
argument.
Regards,
Mumit
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".