From eec53cbdef182192363fe8171243194738e23bb2 Mon Sep 17 00:00:00 2001 From: Evgeny Grablyk Date: Wed, 29 Apr 2009 15:40:40 +0300 Subject: Remove unneeded if statement. --- uzbl.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'uzbl.c') diff --git a/uzbl.c b/uzbl.c index 4c80f6c..538698b 100644 --- a/uzbl.c +++ b/uzbl.c @@ -259,27 +259,23 @@ parse_command(const char *cmd) { gchar * command_param = strtok (NULL, " ,"); if((c = g_hash_table_lookup(commands, command_name)) != NULL){ - if (c != NULL) { - if (c->func_2_params != NULL) { - if (command_param != NULL) { + if (c->func_2_params != NULL) { + if (command_param != NULL) { printf ("command executing: \"%s %s\"\n", command_name, command_param); c->func_2_params (web_view, command_param); - } else { - if (c->func_1_param != NULL) { - printf ("command executing: \"%s\"\n", command_name); - c->func_1_param (web_view); - } else { - fprintf (stderr, "command needs a parameter. \"%s\" is not complete\n", command_name); - } - } - } else if (c->func_1_param != NULL) { - printf ("command executing: \"%s\"\n", command_name); - c->func_1_param (web_view); + } else { + if (c->func_1_param != NULL) { + printf ("command executing: \"%s\"\n", command_name); + c->func_1_param (web_view); + } else + fprintf (stderr, "command needs a parameter. \"%s\" is not complete\n", command_name); } - } else { - fprintf (stderr, "command \"%s\" not understood. ignoring.\n", cmd); + } else if (c->func_1_param != NULL) { + printf ("command executing: \"%s\"\n", command_name); + c->func_1_param (web_view); } - } + } else + fprintf (stderr, "command \"%s\" not understood. ignoring.\n", cmd); } static void -- cgit v1.2.3