aboutsummaryrefslogtreecommitdiff
path: root/lpm.c
diff options
context:
space:
mode:
authorAdam <adamdharrison@gmail.com>2022-10-08 16:14:00 -0400
committerAdam <adamdharrison@gmail.com>2022-10-08 16:14:00 -0400
commitf8b7228c636a2d1309bde70bcebcbb14a8581a4b (patch)
treecaf5909e72fbd9b8ad2d1b72eb26da72f44d91c1 /lpm.c
parenteb368084e9369841ebb1deeb08211002280c439a (diff)
downloadlite-xl-plugin-manager-f8b7228c636a2d1309bde70bcebcbb14a8581a4b.tar.gz
lite-xl-plugin-manager-f8b7228c636a2d1309bde70bcebcbb14a8581a4b.zip
Fixed windows build.
Diffstat (limited to 'lpm.c')
-rw-r--r--lpm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lpm.c b/lpm.c
index 48f1da1..fc2f75c 100644
--- a/lpm.c
+++ b/lpm.c
@@ -188,7 +188,7 @@ static int lpm_rmdir(lua_State *L) {
LPWSTR wpath = utfconv_utf8towc(path);
int deleted = RemoveDirectoryW(wpath);
free(wpath);
- if (!deleted) {
+ if (!deleted)
return luaL_error(L, "can't rmdir %s: %d", path, GetLastError());
#else
if (remove(path))
@@ -500,14 +500,13 @@ int main(int argc, char* argv[]) {
lua_pushliteral(L, LITE_ARCH_TUPLE);
lua_setglobal(L, "ARCH");
#if LPM_LIVE
- if (luaL_loadfile(L, "lpm.lua")) {
+ if (luaL_loadfile(L, "lpm.lua") || lua_pcall(L, 0, 1, 0)) {
#else
- if (luaL_loadbuffer(L, lpm_lua, lpm_lua_len, "lpm.lua")) {
+ if (luaL_loadbuffer(L, lpm_lua, lpm_lua_len, "lpm.lua") || lua_pcall(L, 0, 1, 0)) {
#endif
fprintf(stderr, "internal error when starting the application: %s\n", lua_tostring(L, -1));
return -1;
}
- lua_pcall(L, 0, 1, 0);
int status = lua_tointeger(L, -1);
lua_close(L);
git_libgit2_shutdown();