mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
Update liblua to Lua 5.3.4
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: liolib.c,v 2.149 2016/05/02 14:03:19 roberto Exp $
|
||||
** $Id: liolib.c,v 2.151 2016/12/20 18:37:00 roberto Exp $
|
||||
** Standard I/O (and system) library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -37,10 +37,11 @@
|
||||
#endif
|
||||
|
||||
/* Check whether 'mode' matches '[rwa]%+?[L_MODEEXT]*' */
|
||||
#define l_checkmode(mode) \
|
||||
(*mode != '\0' && strchr("rwa", *(mode++)) != NULL && \
|
||||
(*mode != '+' || (++mode, 1)) && /* skip if char is '+' */ \
|
||||
(strspn(mode, L_MODEEXT) == strlen(mode)))
|
||||
static int l_checkmode (const char *mode) {
|
||||
return (*mode != '\0' && strchr("rwa", *(mode++)) != NULL &&
|
||||
(*mode != '+' || (++mode, 1)) && /* skip if char is '+' */
|
||||
(strspn(mode, L_MODEEXT) == strlen(mode))); /* check extensions */
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -618,8 +619,10 @@ static int g_write (lua_State *L, FILE *f, int arg) {
|
||||
if (lua_type(L, arg) == LUA_TNUMBER) {
|
||||
/* optimization: could be done exactly as for strings */
|
||||
int len = lua_isinteger(L, arg)
|
||||
? fprintf(f, LUA_INTEGER_FMT, lua_tointeger(L, arg))
|
||||
: fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg));
|
||||
? fprintf(f, LUA_INTEGER_FMT,
|
||||
(LUAI_UACINT)lua_tointeger(L, arg))
|
||||
: fprintf(f, LUA_NUMBER_FMT,
|
||||
(LUAI_UACNUMBER)lua_tonumber(L, arg));
|
||||
status = status && (len > 0);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user