changeset 426:c2e4d7b4e0ae

Fix server-side commands.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 24 May 2012 11:38:54 +0300
parents 143fd51048a9
children 341ac6f99439
files main.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/main.c	Thu May 24 11:38:34 2012 +0300
+++ b/main.c	Thu May 24 11:38:54 2012 +0300
@@ -1193,9 +1193,9 @@
     for (i = 0; i < nuserCmds; i++)
     {
         nn_usercmd_t *cmd = &userCmds[i];
-        if (!th_strncasecmp(buf, cmd->cmd, cmd->len))
+        if (!th_strncasecmp(buf + 1, cmd->cmd, cmd->len))
         {
-            char *nbuf = str_trim_left(buf + cmd->len);
+            char *nbuf = str_trim_left(buf + 1 + cmd->len);
 
             switch (cmd->flags)
             {
@@ -1263,7 +1263,7 @@
 
     // Check for commands
     if (buf[0] == '/')
-        return nn_handle_command(conn, buf + 1);
+        return nn_handle_command(conn, buf);
 
     // If current window is not the main room window, send private
     if (currWin != chatWindows[0])