diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2016-05-05 12:46:54 +0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-05-05 12:46:54 +0300 |
commit | 46bbddc5a2384f25afa39a3cc5dea8b07f6310fa (patch) | |
tree | 21454f9a8ab9940b93a0a41b62b48bafcda86ffe | |
parent | 81e5b165bf324689777b967143c751786c405ce4 (diff) | |
download | luafilesystem-46bbddc5a2384f25afa39a3cc5dea8b07f6310fa.tar.gz luafilesystem-46bbddc5a2384f25afa39a3cc5dea8b07f6310fa.tar.bz2 luafilesystem-46bbddc5a2384f25afa39a3cc5dea8b07f6310fa.zip |
Return true instead of 0 on lfs.link success
-rw-r--r-- | src/lfs.c | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -429,13 +429,7 @@ static int make_link (lua_State *L) { | |||
429 | #ifndef _WIN32 | 429 | #ifndef _WIN32 |
430 | const char *oldpath = luaL_checkstring(L, 1); | 430 | const char *oldpath = luaL_checkstring(L, 1); |
431 | const char *newpath = luaL_checkstring(L, 2); | 431 | const char *newpath = luaL_checkstring(L, 2); |
432 | int res = (lua_toboolean(L,3) ? symlink : link)(oldpath, newpath); | 432 | return pushresult(L, (lua_toboolean(L, 3) ? symlink : link)(oldpath, newpath), NULL); |
433 | if (res == -1) { | ||
434 | return pusherror(L, NULL); | ||
435 | } else { | ||
436 | lua_pushinteger(L, 0); | ||
437 | return 1; | ||
438 | } | ||
439 | #else | 433 | #else |
440 | errno = ENOSYS; /* = "Function not implemented" */ | 434 | errno = ENOSYS; /* = "Function not implemented" */ |
441 | return pushresult(L, -1, "make_link is not supported on Windows"); | 435 | return pushresult(L, -1, "make_link is not supported on Windows"); |