nasmlib: fix nasm_str[n]icmp()
authorH. Peter Anvin <hpa@zytor.com>
Sun, 29 Jun 2008 01:31:08 +0000 (18:31 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 29 Jun 2008 01:31:08 +0000 (18:31 -0700)
Fix nasm_str[n]icmp() on platforms which don't have this function
natively.

XXX: Given the new nasm_tolower() implementation, we should consider
if this might actually be a faster function than the platform-native
one.

nasmlib.c

index 0937b66..91eeb2f 100644 (file)
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -168,8 +168,8 @@ int nasm_stricmp(const char *s1, const char *s2)
     int d;
 
     while (1) {
-       c1 = *s1++;
-       c2 = *s2++;
+       c1 = nasm_tolower(*s1++);
+       c2 = nasm_tolower(*s2++);
        d = c1-c2;
 
        if (d)
@@ -188,8 +188,8 @@ int nasm_strnicmp(const char *s1, const char *s2, size_t n)
     int d;
 
     while (n--) {
-       c1 = *s1++;
-       c2 = *s2++;
+       c1 = nasm_tolower(*s1++);
+       c2 = nasm_tolower(*s2++);
        d = c1-c2;
 
        if (d)