mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-24 12:23:08 +00:00
Return true instead of 0 on lfs.link success
This commit is contained in:
@@ -429,13 +429,7 @@ static int make_link (lua_State *L) {
|
|||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
const char *oldpath = luaL_checkstring(L, 1);
|
const char *oldpath = luaL_checkstring(L, 1);
|
||||||
const char *newpath = luaL_checkstring(L, 2);
|
const char *newpath = luaL_checkstring(L, 2);
|
||||||
int res = (lua_toboolean(L,3) ? symlink : link)(oldpath, newpath);
|
return pushresult(L, (lua_toboolean(L, 3) ? symlink : link)(oldpath, newpath), NULL);
|
||||||
if (res == -1) {
|
|
||||||
return pusherror(L, NULL);
|
|
||||||
} else {
|
|
||||||
lua_pushinteger(L, 0);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
errno = ENOSYS; /* = "Function not implemented" */
|
errno = ENOSYS; /* = "Function not implemented" */
|
||||||
return pushresult(L, -1, "make_link is not supported on Windows");
|
return pushresult(L, -1, "make_link is not supported on Windows");
|
||||||
|
|||||||
Reference in New Issue
Block a user