mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
detail (error message)
This commit is contained in:
parent
e3a7104b40
commit
3f6f78ea0b
1 changed files with 2 additions and 3 deletions
5
liolib.c
5
liolib.c
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: liolib.c,v 2.108 2011/11/25 12:50:03 roberto Exp roberto $
|
||||
** $Id: liolib.c,v 2.109 2013/03/16 21:10:18 roberto Exp roberto $
|
||||
** Standard I/O (and system) library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
|
@ -226,8 +226,7 @@ static int io_open (lua_State *L) {
|
|||
(mode[i] != '+' || ++i) && /* skip if char is '+' */
|
||||
(mode[i] != 'b' || ++i) && /* skip if char is 'b' */
|
||||
(mode[i] == '\0')) && !lua_checkmode(mode))
|
||||
return luaL_error(L, "invalid mode " LUA_QS
|
||||
" (should match " LUA_QL("[rwa]%%+?b?") ")", mode);
|
||||
return luaL_argerror(L, 2, "invalid mode");
|
||||
p->f = fopen(filename, mode);
|
||||
return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue