From 1c47b57e195609511c3acd52a6d5e46e8288edca Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 21 Apr 2015 23:45:03 +0100 Subject: [PATCH] Tidy execute alias code --- src/command/commands.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/command/commands.c b/src/command/commands.c index 713cd0ef..529a1019 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -137,18 +137,18 @@ cmd_execute_alias(const char * const inp, gboolean *ran) if (inp[0] != '/') { ran = FALSE; return TRUE; - } else { - char *alias = strdup(inp+1); - char *value = prefs_get_alias(alias); - free(alias); - if (value != NULL) { - *ran = TRUE; - return cmd_process_input(value); - } else { - *ran = FALSE; - return TRUE; - } } + + char *alias = strdup(inp+1); + char *value = prefs_get_alias(alias); + free(alias); + if (value) { + *ran = TRUE; + return cmd_process_input(value); + } + + *ran = FALSE; + return TRUE; } gboolean