On Tue 17 Oct 2000 at 10:37AM +0100, Philip Rowe wrote:
> At 10:05 17/10/00 +0200, you wrote:
> > - replaced stricmp (nonstandard) with strcmp
>
> This looks dodgy to me - stricmp is a case insensitive comparison
> while strcmp IS case sensitive.
> You should probably use strcasecmp for BSD unix and stricmp for windows.
> I'm not sure what the System V unix equivalent is offhand.
> You could add some suitable #ifdef and #define stuff
> so it picks the right one on each platform.
> #ifdef _WINDOWS is a fairly standard way of detecting a Windows compiler.
> #ifdef unix is common among unix compilers, but I'm not sure how standard
> it is.
If you want to do this portably using ANSI C, you really need to write
your own routine which uses tolower() or toupper() to change the case
then regular strcmp(). I have a routine called casecmp() in my parser
which does this job.
James Allwright
To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html