Always parse app_cmdline. It there is nothing to run, commands array will be empty.
Signed-off-by: Justin Cinkelj <justin.cink...@xlab.si> --- loader.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/loader.cc b/loader.cc index 504e230..c3a7256 100644 --- a/loader.cc +++ b/loader.cc @@ -295,10 +295,6 @@ void parse_options(int loader_argc, char** loader_argv) // return the std::string and the commands_args poiting to them as a move std::vector<std::vector<std::string> > prepare_commands(char* app_cmdline) { - if (strlen(app_cmdline) == 0) { - puts("This image has an empty command line. Nothing to run."); - osv::poweroff(); - } std::vector<std::vector<std::string> > commands; bool ok; @@ -308,6 +304,10 @@ std::vector<std::vector<std::string> > prepare_commands(char* app_cmdline) puts("Failed to parse command line."); osv::poweroff(); } + if (commands.size() == 0) { + puts("This image has an empty command line. Nothing to run."); + osv::poweroff(); + } return commands; } -- 2.9.4 -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.