diff options
author | Evan Klitzke <evan@eklitzke.org> | 2015-05-20 15:19:14 -0700 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-05-28 01:03:28 -0300 |
commit | fe63ed318317f4ca91ad5e56a4d77c879b97c8e6 (patch) | |
tree | 12d0e8f4680f76027e17bfd23ab5ee8f77dfc1d9 | |
parent | 09bd226ff479c3ab3b265c1ae721c3ca190d3c83 (diff) |
teach nick_lc to handle # and other non-letters correctly
-rw-r--r-- | nick.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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]; } } |