Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186267
b: refs/heads/master
c: a11d2b6
h: refs/heads/master
i:
  186265: 7fe022d
  186263: b9ff097
v: v3
  • Loading branch information
André Goddard Rosa authored and Linus Torvalds committed Mar 6, 2010
1 parent 32a5b7f commit 913587f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a6e25357d51d6ecf4ee21e9048f0416a085a79c
refs/heads/master: a11d2b64e1f2556953120d516241243ea365f0ae
34 changes: 15 additions & 19 deletions trunk/lib/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,21 @@ int strnicmp(const char *s1, const char *s2, size_t len)
/* Yes, Virginia, it had better be unsigned */
unsigned char c1, c2;

c1 = c2 = 0;
if (len) {
do {
c1 = *s1;
c2 = *s2;
s1++;
s2++;
if (!c1)
break;
if (!c2)
break;
if (c1 == c2)
continue;
c1 = tolower(c1);
c2 = tolower(c2);
if (c1 != c2)
break;
} while (--len);
}
if (!len)
return 0;

do {
c1 = *s1++;
c2 = *s2++;
if (!c1 || !c2)
break;
if (c1 == c2)
continue;
c1 = tolower(c1);
c2 = tolower(c2);
if (c1 != c2)
break;
} while (--len);
return (int)c1 - (int)c2;
}
EXPORT_SYMBOL(strnicmp);
Expand Down

0 comments on commit 913587f

Please sign in to comment.