From caec298a482ed93140401185bf866edacad35742 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 27 Sep 2011 06:45:43 +0200 Subject: Add support for command shortcuts So that distinct substrings of commands, can be used as shortcuts. --- src/io.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/io.c') diff --git a/src/io.c b/src/io.c index 7c69447..1d4d4ec 100644 --- a/src/io.c +++ b/src/io.c @@ -66,6 +66,7 @@ static void process_line(char *line) { struct cmumble_context *ctx = global_rl_user_data; + const char *cmd; int i; g_assert(global_rl_user_data); @@ -80,8 +81,10 @@ process_line(char *line) return; } + cmd = cmumble_command_complete(line); + for (i = 0; ctx->commands[i].name; ++i) { - if (strcmp(line, ctx->commands[i].name) == 0) { + if (strcmp(cmd, ctx->commands[i].name) == 0) { ctx->commands[i].callback(ctx); break; } -- cgit