diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-10-19 12:54:02 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-10-19 12:54:02 -0300 |
| commit | bc84180d12f315f0e036edabc1457c29cb51ee21 (patch) | |
| tree | 4f65b44ff47b4bb662bb725144d31f01ec727fe0 | |
| parent | ad5da6ba1456b5d4d1abbd52d4e04dc78fb41c45 (diff) | |
| download | lua-bc84180d12f315f0e036edabc1457c29cb51ee21.tar.gz lua-bc84180d12f315f0e036edabc1457c29cb51ee21.tar.bz2 lua-bc84180d12f315f0e036edabc1457c29cb51ee21.zip | |
error message in 'os.rename' does not include file name, because error
may be caused both by 'fromname' or 'toname'
| -rw-r--r-- | loslib.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: loslib.c,v 1.38 2011/11/30 12:35:05 roberto Exp roberto $ | 2 | ** $Id: loslib.c,v 1.39 2012/05/23 15:37:09 roberto Exp roberto $ |
| 3 | ** Standard Operating System library | 3 | ** Standard Operating System library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -98,7 +98,7 @@ static int os_remove (lua_State *L) { | |||
| 98 | static int os_rename (lua_State *L) { | 98 | static int os_rename (lua_State *L) { |
| 99 | const char *fromname = luaL_checkstring(L, 1); | 99 | const char *fromname = luaL_checkstring(L, 1); |
| 100 | const char *toname = luaL_checkstring(L, 2); | 100 | const char *toname = luaL_checkstring(L, 2); |
| 101 | return luaL_fileresult(L, rename(fromname, toname) == 0, fromname); | 101 | return luaL_fileresult(L, rename(fromname, toname) == 0, NULL); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | 104 | ||
