dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/image winres_reader.c,1.1,1.2


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/image winres_reader.c,1.1,1.2
Date: Tue, 08 Jul 2003 06:14:40 -0400

Update of /cvsroot/dotgnu-pnet/pnet/image
In directory subversions:/tmp/cvs-serv6722/image

Modified Files:
        winres_reader.c 
Log Message:


Add "ILStrNICmp" as a common support function.


Index: winres_reader.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/winres_reader.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** winres_reader.c     7 Jul 2003 12:44:50 -0000       1.1
--- winres_reader.c     8 Jul 2003 10:14:38 -0000       1.2
***************
*** 54,104 ****
  
  /*
-  * 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;
-       }
- }
- 
- /*
   * Read the name of a resource from the resource section.
   */
--- 54,57 ----
***************
*** 415,419 ****
                {
                        if(entry->nameLen == posn &&
!                          !StrNICmp(entry->name, name, posn))
                        {
                                break;
--- 368,372 ----
                {
                        if(entry->nameLen == posn &&
!                          !ILStrNICmp(entry->name, name, posn))
                        {
                                break;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]