aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lpm.c4
1 files 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__