diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-03-20 16:40:07 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-03-20 16:40:07 -0300 |
commit | 3f6f78ea0b09f2dc558576926b74cb8f4bb7eb8b (patch) | |
tree | 9c1d8b46fccbafe3eb75a31e25d32892b7ac4748 /liolib.c | |
parent | e3a7104b404d9e19f8f125fa603a5d40a63f553d (diff) | |
download | lua-3f6f78ea0b09f2dc558576926b74cb8f4bb7eb8b.tar.gz lua-3f6f78ea0b09f2dc558576926b74cb8f4bb7eb8b.tar.bz2 lua-3f6f78ea0b09f2dc558576926b74cb8f4bb7eb8b.zip |
detail (error message)
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 2.108 2011/11/25 12:50:03 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.109 2013/03/16 21:10:18 roberto Exp roberto $ |
3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -226,8 +226,7 @@ static int io_open (lua_State *L) { | |||
226 | (mode[i] != '+' || ++i) && /* skip if char is '+' */ | 226 | (mode[i] != '+' || ++i) && /* skip if char is '+' */ |
227 | (mode[i] != 'b' || ++i) && /* skip if char is 'b' */ | 227 | (mode[i] != 'b' || ++i) && /* skip if char is 'b' */ |
228 | (mode[i] == '\0')) && !lua_checkmode(mode)) | 228 | (mode[i] == '\0')) && !lua_checkmode(mode)) |
229 | return luaL_error(L, "invalid mode " LUA_QS | 229 | return luaL_argerror(L, 2, "invalid mode"); |
230 | " (should match " LUA_QL("[rwa]%%+?b?") ")", mode); | ||
231 | p->f = fopen(filename, mode); | 230 | p->f = fopen(filename, mode); |
232 | return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; | 231 | return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; |
233 | } | 232 | } |