]> granicus.if.org Git - neomutt/commitdiff
The previous fix was complete nonsense. What a day. :-(
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 5 Feb 2002 22:01:06 +0000 (22:01 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 5 Feb 2002 22:01:06 +0000 (22:01 +0000)
ascii.c

diff --git a/ascii.c b/ascii.c
index 59dfb440d27caf99c81ee47330d060362f45a075..d4553f683012a648a235dfcbcd0be5948e527a6a 100644 (file)
--- a/ascii.c
+++ b/ascii.c
@@ -67,13 +67,13 @@ int ascii_strcasecmp (const char *a, const char *b)
   if (b == NULL && a)
     return 1;
   
-  for (; *a && *b; a++, b++)
+  for (; *a || *b; a++, b++)
   {
     if ((i = ascii_tolower (*a) - ascii_tolower (*b)))
       return i;
   }
-
-  return ascii_tolower (*a) - ascii_tolower (*b);
+  
+  return 0;
 }
 
 int ascii_strncasecmp (const char *a, const char *b, int n)
@@ -87,13 +87,11 @@ int ascii_strncasecmp (const char *a, const char *b, int n)
   if (b == NULL && a)
     return 1;
   
-  for (j = 0; (*a && *b) && j < n; a++, b++, j++)
+  for (j = 0; (*a || *b) && j < n; a++, b++, j++)
   {
     if ((i = ascii_tolower (*a) - ascii_tolower (*b)))
       return i;
   }
-  if (j < n)
-    return ascii_tolower (*a) - ascii_tolower (*b);
-  else
-    return 0;
+  
+  return 0;
 }