aboutsummaryrefslogtreecommitdiffstats
path: root/nick.c
diff options
context:
space:
mode:
authorEvan Klitzke <evan@eklitzke.org>2015-05-20 15:19:14 -0700
committerdequis <dx@dxzone.com.ar>2015-05-28 01:03:28 -0300
commitfe63ed318317f4ca91ad5e56a4d77c879b97c8e6 (patch)
tree12d0e8f4680f76027e17bfd23ab5ee8f77dfc1d9 /nick.c
parent09bd226ff479c3ab3b265c1ae721c3ca190d3c83 (diff)
teach nick_lc to handle # and other non-letters correctly
Diffstat (limited to 'nick.c')
-rw-r--r--nick.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/nick.c b/nick.c
index fb84f986..31cf4f34 100644
--- a/nick.c
+++ b/nick.c
@@ -367,9 +367,13 @@ int nick_lc(irc_t *irc, char *nick)
int i;
if (tab['A'] == 0) {
+ /* initialize table so nonchars are mapped to themselves */
+ for (i = 0; i < sizeof(tab); i++) {
+ tab[i] = i;
+ }
+ /* replace uppercase chars with lowercase chars */
for (i = 0; nick_lc_chars[i]; i++) {
tab[(int) nick_uc_chars[i]] = nick_lc_chars[i];
- tab[(int) nick_lc_chars[i]] = nick_lc_chars[i];
}
}