diff options
author | James Booth <boothj5@gmail.com> | 2012-02-18 23:17:01 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-02-18 23:17:01 +0000 |
commit | 94c97e08abbd546d4a8ff01258d6b4605049668b (patch) | |
tree | 2adadae21287d6b7ae9338b8f3dcedcfd6763d52 | |
parent | 34fba754ea5122575b0a3ea1f3a76de96e973e81 (diff) | |
download | profani-tty-94c97e08abbd546d4a8ff01258d6b4605049668b.tar.gz |
Handle nothing in main command
-rw-r--r-- | command.c | 25 | ||||
-rw-r--r-- | command.h | 2 |
2 files changed, 17 insertions, 10 deletions
diff --git a/command.c b/command.c index 9022fd9f..80858d63 100644 --- a/command.c +++ b/command.c @@ -55,21 +55,28 @@ int handle_start_command(char *inp) return result; } -int handle_command(char *cmd) +int handle_command(char *inp) { int result = FALSE; - if (strcmp(cmd, "/quit") == 0) { + + // handle nothing + if (strlen(inp) == 0) { + gui_refresh(); + return TRUE; + } + + if (strcmp(inp, "/quit") == 0) { result = _cmd_quit(); - } else if (strncmp(cmd, "/help", 5) == 0) { + } else if (strncmp(inp, "/help", 5) == 0) { result = _cmd_help(); - } else if (strncmp(cmd, "/who", 4) == 0) { + } else if (strncmp(inp, "/who", 4) == 0) { result = _cmd_who(); - } else if (strncmp(cmd, "/msg ", 5) == 0) { - result = _cmd_msg(cmd); - } else if (strncmp(cmd, "/close", 6) == 0) { - result = _cmd_close(cmd); + } else if (strncmp(inp, "/msg ", 5) == 0) { + result = _cmd_msg(inp); + } else if (strncmp(inp, "/close", 6) == 0) { + result = _cmd_close(inp); } else { - result = _cmd_default(cmd); + result = _cmd_default(inp); } inp_clear(); diff --git a/command.h b/command.h index 6180e313..b0b2cbea 100644 --- a/command.h +++ b/command.h @@ -6,6 +6,6 @@ #define QUIT_PROF 3 int handle_start_command(char *inp); -int handle_command(char *cmd); +int handle_command(char *inp); #endif |