# HG changeset patch # User Matti Hamalainen # Date 1337972515 -10800 # Node ID 96cb82ebb93b76545b398a632c4995b743d9dfc2 # Parent ecbd9773c74be3fb9f7e8ca8a2191ba4dd3157c3 Rename a structure member. diff -r ecbd9773c74b -r 96cb82ebb93b main.c --- a/main.c Fri May 25 21:43:21 2012 +0300 +++ b/main.c Fri May 25 22:01:55 2012 +0300 @@ -842,7 +842,7 @@ typedef struct { - char *cmd; + char *name; size_t len; int (*handler)(nn_conn_t *); } nn_protocolcmd_t; @@ -869,14 +869,14 @@ if (!protoCmdsInit) { for (i = 0; i < nprotoCmds; i++) - protoCmds[i].len = strlen(protoCmds[i].cmd); + protoCmds[i].len = strlen(protoCmds[i].name); protoCmdsInit = TRUE; } for (i = 0; i < nprotoCmds; i++) { - if (!nn_conn_buf_strncmp(conn, protoCmds[i].cmd, protoCmds[i].len)) + if (!nn_conn_buf_strncmp(conn, protoCmds[i].name, protoCmds[i].len)) return protoCmds[i].handler(conn); } @@ -1149,7 +1149,7 @@ typedef struct { - char *cmd; + char *name; int flags; size_t len; int (*handler)(nn_conn_t *, char *buf); @@ -1191,7 +1191,7 @@ if (!userCmdsInit) { for (i = 0; i < nuserCmds; i++) - userCmds[i].len = strlen(userCmds[i].cmd); + userCmds[i].len = strlen(userCmds[i].name); userCmdsInit = TRUE; } @@ -1200,7 +1200,7 @@ for (i = 0; i < nuserCmds; i++) { nn_usercmd_t *cmd = &userCmds[i]; - if (!th_strncasecmp(buf + 1, cmd->cmd, cmd->len)) + if (!th_strncasecmp(buf + 1, cmd->name, cmd->len)) { char *nbuf = str_trim_left(buf + 1 + cmd->len); @@ -1210,7 +1210,7 @@ case CMDARG_STRING: if (!nbuf[0]) { - printMsgQ(currWin, "Command: /%s requires an argument.\n", cmd->cmd); + printMsgQ(currWin, "Command: /%s requires an argument.\n", cmd->name); return 1; } break; @@ -1218,7 +1218,7 @@ case CMDARG_NONE: if (nbuf[0]) { - printMsgQ(currWin, "Command: /%s does not take arguments.\n", cmd->cmd); + printMsgQ(currWin, "Command: /%s does not take arguments.\n", cmd->name); return 1; } break;