From a2369d8e89e596d7be4cdd331043837083d51ec4 Mon Sep 17 00:00:00 2001 From: Charles Brej Date: Fri, 21 Nov 2008 16:58:25 +0000 Subject: [PATCH] When fail when a command parser command is not in list then fail. Previously it returned the last in the list. --- src/libply/ply-command-parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libply/ply-command-parser.c b/src/libply/ply-command-parser.c index 74c566ab..c6adf32a 100644 --- a/src/libply/ply-command-parser.c +++ b/src/libply/ply-command-parser.c @@ -427,12 +427,12 @@ ply_command_parser_get_command (ply_command_parser_t *parser, next_node = ply_list_get_next_node (parser->available_subcommands, node); if (strcmp (command_name, command->name) == 0) - break; + return command; node = next_node; } - return command; + return NULL; } static void @@ -858,7 +858,7 @@ on_show_splash (ply_command_parser_t *parser, plugin_name = NULL; ply_command_parser_get_command_options (parser, command, "plugin-name", &plugin_name, NULL); - printf ("show splash plugin '%s'", plugin_name); + printf ("show splash plugin '%s'\n", plugin_name); free (plugin_name); }