update to lua 5.3.3 rc2

This commit is contained in:
Cloud Wu
2016-05-19 13:16:19 +08:00
parent cc3e985834
commit de176b735f
3 changed files with 20 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lstrlib.c,v 1.248 2016/05/02 13:58:01 roberto Exp $
** $Id: lstrlib.c,v 1.250 2016/05/18 18:19:51 roberto Exp $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -958,8 +958,8 @@ static void addliteral (lua_State *L, luaL_Buffer *b, int arg) {
addliteralnum(L, b, lua_tonumber(L, arg));
break;
}
/* else integers; write in "native" format *//* FALLTHROUGH */
}
/* else integers; write in "native" format */
} /* FALLTHROUGH */
case LUA_TNIL: case LUA_TBOOLEAN: {
luaL_tolstring(L, arg, NULL);
luaL_addvalue(b);
@@ -1369,13 +1369,11 @@ static int str_pack (lua_State *L) {
case Kchar: { /* fixed-size string */
size_t len;
const char *s = luaL_checklstring(L, arg, &len);
if ((size_t)size <= len) /* string larger than (or equal to) needed? */
luaL_addlstring(&b, s, size); /* truncate string to asked size */
else { /* string smaller than needed */
luaL_addlstring(&b, s, len); /* add it all */
while (len++ < (size_t)size) /* pad extra space */
luaL_addchar(&b, LUAL_PACKPADBYTE);
}
luaL_argcheck(L, len <= (size_t)size, arg,
"string longer than given size");
luaL_addlstring(&b, s, len); /* add string */
while (len++ < (size_t)size) /* pad extra space */
luaL_addchar(&b, LUAL_PACKPADBYTE);
break;
}
case Kstring: { /* strings with length count */