From: Charles Brej Date: Fri, 21 Nov 2008 16:58:25 +0000 (+0000) Subject: When fail when a command parser command is not in list then fail. X-Git-Tag: 0.6.0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2369d8e89e596d7be4cdd331043837083d51ec4;p=thirdparty%2Fplymouth.git When fail when a command parser command is not in list then fail. Previously it returned the last in the list. --- 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); }