aboutsummaryrefslogtreecommitdiff
path: root/src/lua_state.cc
diff options
context:
space:
mode:
authordacctal <dacctal@symlinx.net>2026-05-02 09:20:36 +0000
committerdacctal <dacctal@symlinx.net>2026-05-02 09:20:36 +0000
commit979a9571b7118822e67735654b36498fb8010c2a (patch)
tree61774c2b653464c1d5e1fb02917c62b40421cf71 /src/lua_state.cc
parentac6c1dfd676eedca3e1b3c4d5c3b0ecf32fc1539 (diff)
clumsy me, flipping values for no good reason
Diffstat (limited to 'src/lua_state.cc')
-rw-r--r--src/lua_state.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/lua_state.cc b/src/lua_state.cc
index 5e79fdd..919a304 100644
--- a/src/lua_state.cc
+++ b/src/lua_state.cc
@@ -106,7 +106,7 @@ bool repo_build(const char *repository) {
}
bool bldit(const char *target) {
- lua_State *B = luaL_newstate();
+ lua_State* B = luaL_newstate();
luaL_openlibs(B);
if (luaL_loadfile(B, "bldit.lua") || lua_pcall(B, 0, 0, 0)) {
std::cout << print_warning << "cannot run bldit script: " << lua_tostring(B, -1) << "\n";
@@ -119,18 +119,15 @@ bool bldit(const char *target) {
}
std::cout << print_pkgit << "bldit variable 'targets' used successfully.\n";
lua_getfield(B, -1, target);
- if (!lua_istable(L, -1)) {
- std::cout << print_warning << "bldit variable '" << target
- << "' is not a table.\n";
+ if (!lua_istable(B, -1)) {
+ std::cout << print_warning << "bldit variable '" << target << "' is not a table.\n";
lua_pop(B, 2);
return false;
}
- std::cout << print_pkgit << "bldit variable '" << target
- << "' used successfully.\n";
+ std::cout << print_pkgit << "bldit variable '" << target << "' used successfully.\n";
lua_getfield(B, -1, "build");
if (!lua_isfunction(B, -1)) {
- std::cout << "'repositories' lua variable 'build' is not a function."
- << std::endl;
+ std::cout << "'repositories' lua variable 'build' is not a function." << std::endl;
lua_pop(B, 3);
return false;
}