/* src/client/command_db.c */
#include "command_db.h"
+#include <stddef.h> /* NULL */
#include <stdint.h> /* uint8_t, uint32_t */
#include <stdio.h> /* FILE */
#include <stdlib.h> /* free() */
-extern struct Command * get_command_data(char * dsc_short)
+extern struct Command * get_command(char * dsc_short)
{
struct Command * cmd_ptr = world.cmd_db.cmds;
uint8_t i = 0;
copy_tokenized_string(line, &world.cmd_db.cmds[i].dsc_short, delim);
copy_tokenized_string(NULL, &world.cmd_db.cmds[i].server_msg, delim);
if (!strcmp("0", world.cmd_db.cmds[i].server_msg))
- {
- free(world.cmd_db.cmds[i].server_msg);
- world.cmd_db.cmds[i].server_msg = NULL;
- }
+ { /* .server_msg==0 detects */
+ free(world.cmd_db.cmds[i].server_msg); /* non-server commands in */
+ world.cmd_db.cmds[i].server_msg = NULL;/* control.h's try_key() / */
+ } /* try_server_command(). */
char * arg_string = strtok(NULL, delim);
world.cmd_db.cmds[i].arg = arg_string[0];
copy_tokenized_string(NULL, &world.cmd_db.cmds[i].dsc_long, "\n");