stand/lua: Correct some trivial errors in config

An empty module_path to start with isn't ideal, but if all modules are
contained within a kernel directory (which is what we just tested) then it
isn't strictly an error. Don't assume that module_path has a value already.

When we fail to load the kernel, printing the result (which is guaranteed to
be nil) is not intended; print the name of the kernel.
This commit is contained in:
kevans 2018-02-17 04:22:36 +00:00
parent ea1a599826
commit 0afa86db89

View File

@ -297,7 +297,10 @@ function config.loadkernel()
-- succeeded add path to module_path
if res ~= nil then
loader.setenv("module_path", v..";"..module_path);
if module_path == nil then
loader.setenv("module_path", v..";"..
module_path);
end
return true;
end
end
@ -308,7 +311,7 @@ function config.loadkernel()
if res ~= nil then
return true;
else
print("Failed to load kernel '"..res.."'");
print("Failed to load kernel '"..kernel.."'");
return false;
end
end