Return true instead of 0 on lfs.link success

This commit is contained in:
Peter Melnichenko
2016-05-05 12:46:54 +03:00
parent 81e5b165bf
commit 46bbddc5a2

View File

@@ -429,13 +429,7 @@ static int make_link (lua_State *L) {
#ifndef _WIN32
const char *oldpath = luaL_checkstring(L, 1);
const char *newpath = luaL_checkstring(L, 2);
int res = (lua_toboolean(L,3) ? symlink : link)(oldpath, newpath);
if (res == -1) {
return pusherror(L, NULL);
} else {
lua_pushinteger(L, 0);
return 1;
}
return pushresult(L, (lua_toboolean(L, 3) ? symlink : link)(oldpath, newpath), NULL);
#else
errno = ENOSYS; /* = "Function not implemented" */
return pushresult(L, -1, "make_link is not supported on Windows");