~jb55/cmdtree

62a9e6b170d9c7474e77de31c46d5d35f0cda0ba — William Casarin 1 year, 10 months ago 4f0b9cf
let's keep it simple for now
1 files changed, 1 insertions(+), 8 deletions(-)

M command.c
M command.c => command.c +1 -8
@@ 8,13 8,6 @@

#include "util.h"

static const char *
bind_name_to_bind(const char *bind) {
	if (strcmp(bind, "STR") == 0)
		return " ";
	return bind;
}

int
command_is_prefix(struct command *cmd) {
	return cmd->nchildren > 0;


@@ 35,7 28,7 @@ command_num_children(struct command *cmd) {
struct command *
command_lookup(struct command *cmd, int ncmds, const char *binding) {
	for (int i = 0; i < ncmds; ++i) {
		if (strcmp(binding, bind_name_to_bind(cmd[i].bind)) == 0)
		if (strcmp(binding, cmd[i].bind) == 0)
			return &cmd[i];
	}