[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/cscc/common cc_compat.c,1.1,1.2
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/cscc/common cc_compat.c,1.1,1.2 |
Date: |
Tue, 08 Jul 2003 06:14:40 -0400 |
Update of /cvsroot/dotgnu-pnet/pnet/cscc/common
In directory subversions:/tmp/cvs-serv6722/cscc/common
Modified Files:
cc_compat.c
Log Message:
Add "ILStrNICmp" as a common support function.
Index: cc_compat.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/common/cc_compat.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** cc_compat.c 28 Dec 2002 05:07:51 -0000 1.1
--- cc_compat.c 8 Jul 2003 10:14:38 -0000 1.2
***************
*** 502,552 ****
/*
- * Length-delimited string comparison with ignore case.
- */
- static int StrNICmp(const char *str1, const char *str2, int len)
- {
- char ch1;
- char ch2;
- while(len > 0 && *str1 != '\0' && *str2 != '\0')
- {
- ch1 = *str1++;
- if(ch1 >= 'A' && ch1 <= 'Z')
- {
- ch1 = (ch1 - 'A' + 'a');
- }
- ch2 = *str2++;
- if(ch2 >= 'A' && ch2 <= 'Z')
- {
- ch2 = (ch2 - 'A' + 'a');
- }
- if(ch1 < ch2)
- {
- return -1;
- }
- else if(ch1 > ch2)
- {
- return 1;
- }
- --len;
- }
- if(!len)
- {
- return 0;
- }
- if(*str1 != '\0')
- {
- return 1;
- }
- else if(*str2 != '\0')
- {
- return -1;
- }
- else
- {
- return 0;
- }
- }
-
- /*
* Determine if a command-line looks like something that should
* be processed using the compatibility parser.
--- 502,505 ----
***************
*** 593,597 ****
if(opt->nameSize)
{
! if(!StrNICmp(argv[posn], opt->name,
opt->nameSize) &&
(argv[posn][opt->nameSize] == ':' ||
argv[posn][opt->nameSize] == '=' ||
--- 546,550 ----
if(opt->nameSize)
{
! if(!ILStrNICmp(argv[posn], opt->name,
opt->nameSize) &&
(argv[posn][opt->nameSize] == ':' ||
argv[posn][opt->nameSize] == '=' ||
***************
*** 658,662 ****
if(size)
{
! if(!StrNICmp(argv[posn], opt->name, size) &&
(argv[posn][size] == ':' || argv[posn][size]
== '='))
{
--- 611,615 ----
if(size)
{
! if(!ILStrNICmp(argv[posn], opt->name, size) &&
(argv[posn][size] == ':' || argv[posn][size]
== '='))
{
***************
*** 665,669 ****
break;
}
! else if(!StrNICmp(argv[posn], opt->name, size)
&&
argv[posn][size] != '\0' &&
opt->nameSize < 0)
{
--- 618,622 ----
break;
}
! else if(!ILStrNICmp(argv[posn], opt->name,
size) &&
argv[posn][size] != '\0' &&
opt->nameSize < 0)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/cscc/common cc_compat.c,1.1,1.2,
Rhys Weatherley <address@hidden> <=