diff options
author | Li Jin <dragon-fly@qq.com> | 2024-10-19 00:35:11 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2024-10-19 00:35:11 +0800 |
commit | 1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0 (patch) | |
tree | 8bd3fbeb396fd2fce6e5b34c3ee10f4923feca72 /src/3rdParty/lua/loslib.c | |
parent | 05da3cbfa3689e6c229c41156d0dd08ab554cd77 (diff) | |
download | yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.tar.gz yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.tar.bz2 yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.zip |
Fixed issue #174.
Diffstat (limited to 'src/3rdParty/lua/loslib.c')
-rw-r--r-- | src/3rdParty/lua/loslib.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/3rdParty/lua/loslib.c b/src/3rdParty/lua/loslib.c index ad5a927..ba80d72 100644 --- a/src/3rdParty/lua/loslib.c +++ b/src/3rdParty/lua/loslib.c | |||
@@ -155,6 +155,7 @@ static int os_execute (lua_State *L) { | |||
155 | 155 | ||
156 | static int os_remove (lua_State *L) { | 156 | static int os_remove (lua_State *L) { |
157 | const char *filename = luaL_checkstring(L, 1); | 157 | const char *filename = luaL_checkstring(L, 1); |
158 | errno = 0; | ||
158 | return luaL_fileresult(L, remove(filename) == 0, filename); | 159 | return luaL_fileresult(L, remove(filename) == 0, filename); |
159 | } | 160 | } |
160 | 161 | ||
@@ -162,6 +163,7 @@ static int os_remove (lua_State *L) { | |||
162 | static int os_rename (lua_State *L) { | 163 | static int os_rename (lua_State *L) { |
163 | const char *fromname = luaL_checkstring(L, 1); | 164 | const char *fromname = luaL_checkstring(L, 1); |
164 | const char *toname = luaL_checkstring(L, 2); | 165 | const char *toname = luaL_checkstring(L, 2); |
166 | errno = 0; | ||
165 | return luaL_fileresult(L, rename(fromname, toname) == 0, NULL); | 167 | return luaL_fileresult(L, rename(fromname, toname) == 0, NULL); |
166 | } | 168 | } |
167 | 169 | ||