delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/11/27/10:21:21

From: steven AT cs DOT uu DOT nl (Steven van Dijk)
Subject: B19, EGCS 1.1: Strcasecmp uses uppercase?
27 Nov 1998 10:21:21 -0800 :
Message-ID: <3.0.5.32.19981127103534.00947a10.cygnus.gnu-win32@pop.cs.uu.nl>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Hi,

Compiling the following on my system and on an Unix system gives different
results:

#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


The program I am porting expects "_" to be smaller than "t" and therefore
crashes. The implementation of strcasecmp EGCS 1.1 gives maps all alpha's
to their uppercase code. I have not found a reference to this issue in the
archives or the FAQ (or I overlooked it) so I am asking here: is this
correct? And how can I cope with this?

Please send a copy of your reply to me directly (steven AT cs DOT uu DOT nl) since I
am not subscribed.


While I am at it, is there anyone who knows how I can cope with the absence
of an implementation of mkfifo in the Cygwin lib? 


								Dag,
								Steven
--- (http://www.cs.uu.nl/staff/steven.html)
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019