From 805f4373d787e542c7f3d6142ebdeea3a3a63072 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 13 Oct 2022 17:50:19 -0400 Subject: Fixed syntax. --- lpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lpm.c b/lpm.c index 42fdafa..944a98a 100644 --- a/lpm.c +++ b/lpm.c @@ -223,12 +223,12 @@ static int lpm_stat(lua_State *L) { int err = lstat(path, &s); char *abs_path = realpath(path, NULL); #endif - if (err || !res) { + if (err || !abs_path) { lua_pushnil(L); lua_pushstring(L, strerror(errno)); return 2; } - lua_pushstring(L, abs_path) lua_setfield(L, -2, "abs_path"); + lua_pushstring(L, abs_path); lua_setfield(L, -2, "abs_path"); lua_pushvalue(L, 1); lua_setfield(L, -2, "path"); #if __linux__ -- cgit v1.2.3