fishlim: Use hexchat_nickcmp()

This commit is contained in:
TingPing committed 2014-12-15 15:06:48 -05:00
1 parent c54a0c6db9
commit bdb5c3eb9d
4 files changed
+5 -27

No files matched your search

-26
View File
@@ -76,29 +76,3 @@ char *irc_prefix_get_nick(const char *prefix) {
length = end - prefix;
return g_strndup (prefix, length);
}
/**
* Compares two nick names. Return 0 if equal. Otherwise the return value is
* less than zero if a is less than b or greater than zero if a is greater
* than b.
*/
int irc_nick_cmp(const char *a, const char *b) {
char ac;
char bc;
char diff;
for (;;) {
ac = *(a++);
bc = *(b++);
// Change into IRC uppercase (see RFC 2812 section 2.2)
if (ac >= 'a' && ac <= '~') ac &= ~0x20;
if (bc >= 'a' && bc <= '~') bc &= ~0x20;
diff = ac - bc;
if (diff) return diff;
if (!ac) return 0;
}
}