]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
When fail when a command parser command is not in list then fail.
authorCharles Brej <cbrej@cs.man.ac.uk>
Fri, 21 Nov 2008 16:58:25 +0000 (16:58 +0000)
committerCharles Brej <cbrej@cs.man.ac.uk>
Fri, 21 Nov 2008 16:58:25 +0000 (16:58 +0000)
Previously it returned the last in the list.

src/libply/ply-command-parser.c

index 74c566ab8d24b59e013c7f5f9d8f7eebc96432e7..c6adf32afc91d25ef3728d0d977aa034160e747c 100644 (file)
@@ -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);
 }