# HG changeset patch # User Matti Hamalainen # Date 1287935099 -10800 # Node ID 9db08807018fbd5e7fd8e4c17f765c02564ff283 # Parent 8af4072dc31a1375cffbe7cd96980c299b88456b Make local commands case-insensitive. diff -r 8af4072dc31a -r 9db08807018f nnchat.c --- a/nnchat.c Sun Oct 24 18:28:22 2010 +0300 +++ b/nnchat.c Sun Oct 24 18:44:59 2010 +0300 @@ -566,7 +566,7 @@ /* Check for special user commands */ if (*buf == 0) { return 1; - } else if (!strncmp(buf, "/color ", 7)) { + } else if (!strncasecmp(buf, "/color ", 7)) { /* Change color */ int tmpInt; if ((tmpInt = getColor(buf+7)) < 0) { @@ -577,7 +577,7 @@ printMsg("Setting color to #%06x\n", optUserColor); nn_send_msg(sock, optUserName2, "%%2FSetFontColor%%20%%2Dcolor%%20%06X", optUserColor); return 0; - } else if (!strncmp(buf, "/w ", 3)) { + } else if (!strncasecmp(buf, "/w ", 3)) { /* Open given username's profile via firefox in a new tab */ char *name = buf + 3; pid_t pud; @@ -589,13 +589,13 @@ printMsg("%s\n", tmpBuf); system(tmpBuf); return 0; - } else if (!strncmp(buf, "/to ", 4)) { + } else if (!strncasecmp(buf, "/to ", 4)) { /* Set private messaging target */ th_free(setTarget); setTarget = th_strdup(buf + 4); printMsg("Set prv target to '%s'\n", setTarget); return 0; - } else if (!strncmp(buf, "/who", 4)) { + } else if (!strncasecmp(buf, "/who", 4)) { /* Alias /who to /listallusers */ snprintf(tmpBuf, sizeof(tmpBuf), "/listallusers"); buf = tmpBuf;