summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 87347b8)
raw | patch | inline | side by side (parent: 87347b8)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 5 Jun 2016 19:41:39 +0000 (21:41 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 25 Sep 2016 10:42:45 +0000 (12:42 +0200) |
src/utils_cmds.c | patch | blob | history |
diff --git a/src/utils_cmds.c b/src/utils_cmds.c
index 9ff9d4d6b1828e2ee2fc76d9cbfeb4a76ffdc114..f574c6a171823fc2b0314e1edabbe1ecf3f79982 100644 (file)
--- a/src/utils_cmds.c
+++ b/src/utils_cmds.c
cmd_t *ret_cmd, cmd_error_handler_t *err)
{
char *command = NULL;
+ cmd_status_t status;
if ((argc < 1) || (argv == NULL) || (ret_cmd == NULL))
{
if (strcasecmp ("FLUSH", command) == 0)
{
ret_cmd->type = CMD_FLUSH;
- return cmd_parse_flush (argc - 1, argv + 1,
+ status = cmd_parse_flush (argc - 1, argv + 1,
&ret_cmd->cmd.flush, err);
}
else if (strcasecmp ("GETVAL", command) == 0)
{
ret_cmd->type = CMD_GETVAL;
- return cmd_parse_getval (argc - 1, argv + 1,
+ status = cmd_parse_getval (argc - 1, argv + 1,
&ret_cmd->cmd.getval, err);
}
else if (strcasecmp ("LISTVAL", command) == 0)
{
ret_cmd->type = CMD_LISTVAL;
- return cmd_parse_listval (argc - 1, argv + 1,
+ status = cmd_parse_listval (argc - 1, argv + 1,
&ret_cmd->cmd.listval, err);
}
else if (strcasecmp ("PUTVAL", command) == 0)
{
ret_cmd->type = CMD_PUTVAL;
- return cmd_parse_putval (argc - 1, argv + 1,
+ status = cmd_parse_putval (argc - 1, argv + 1,
&ret_cmd->cmd.putval, err);
}
else
return (CMD_UNKNOWN_COMMAND);
}
- return (CMD_OK);
+ if (status != CMD_OK)
+ ret_cmd->type = CMD_UNKNOWN;
+ return (status);
} /* cmd_status_t cmd_parsev */
cmd_status_t cmd_parse (char *buffer,