Diff for /np2/common/milstr.c between versions 1.1 and 1.2

version 1.1, 2003/10/16 17:57:09 version 1.2, 2003/10/29 21:35:58
Line 9  BOOL milstr_cmp(const char *str, const c Line 9  BOOL milstr_cmp(const char *str, const c
         while(1) {          while(1) {
                 s = (BYTE)*str++;                  s = (BYTE)*str++;
                 if ((((s ^ 0x20) - 0xa1) & 0xff) < 0x3c) {                  if ((((s ^ 0x20) - 0xa1) & 0xff) < 0x3c) {
                         if (s != (BYTE)*cmp++) {                          c = (BYTE)*cmp++;
                           if (s != c) {
                                 goto mscp_err;                                  goto mscp_err;
                         }                          }
                         s = (BYTE)*str++;                          s = (BYTE)*str++;
                         c = (BYTE)*cmp++;                          c = (BYTE)*cmp++;
                 }                  }
                 else {                  else {
                         if (((s - 'A') & 0xff) < 0x1a) {                          if (((s - 'a') & 0xff) < 26) {
                                 s |= 0x20;                                  s -= 0x20;
                         }                          }
                         c = (BYTE)*cmp++;                          c = (BYTE)*cmp++;
                         if (((c - 'A') & 0xff) < 0x1a) {                          if (((c - 'a') & 0xff) < 26) {
                                 c |= 0x20;                                  c -= 0x20;
                         }                          }
                 }                  }
                 if (s != c) {                  if (s != c) {
Line 34  BOOL milstr_cmp(const char *str, const c Line 35  BOOL milstr_cmp(const char *str, const c
         return(0);          return(0);
   
 mscp_err:  mscp_err:
         return(1);          return((s > c)?1:-1);
 }  }
   
 BOOL milstr_memcmp(const char *str, const char *cmp) {  BOOL milstr_memcmp(const char *str, const char *cmp) {
Line 45  BOOL milstr_memcmp(const char *str, cons Line 46  BOOL milstr_memcmp(const char *str, cons
         do {          do {
                 c = (BYTE)*cmp++;                  c = (BYTE)*cmp++;
                 if ((((c ^ 0x20) - 0xa1) & 0xff) < 0x3c) {                  if ((((c ^ 0x20) - 0xa1) & 0xff) < 0x3c) {
                         if (c != (BYTE)*str++) {                          s = (BYTE)*str++;
                           if (c != s) {
                                 break;                                  break;
                         }                          }
                         c = (BYTE)*cmp++;                          c = (BYTE)*cmp++;
                         s = (BYTE)*str++;                          s = (BYTE)*str++;
                 }                  }
                 else if (c) {                  else if (c) {
                         if (((c - 'A') & 0xff) < 26) {                          if (((c - 'a') & 0xff) < 26) {
                                 c |= 0x20;                                  c &= ~0x20;
                         }                          }
                         s = (BYTE)*str++;                          s = (BYTE)*str++;
                         if (((s - 'A') & 0xff) < 26) {                          if (((s - 'a') & 0xff) < 26) {
                                 s |= 0x20;                                  s &= ~0x20;
                         }                          }
                 }                  }
                 else {                  else {

Removed from v.1.1  
changed lines
  Added in v.1.2


RetroPC.NET-CVS <cvs@retropc.net>