commit 74e10b9c3b7bdc5dd1b2fe61149b6244f3d95a03
parent b044b8c1824749d10ffdb0159dcd794da8c29cfe
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Sat, 8 Nov 2014 16:12:28 -0200
details (error messages)
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lstrlib.c b/lstrlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstrlib.c,v 1.214 2014/11/05 18:50:29 roberto Exp roberto $
+** $Id: lstrlib.c,v 1.215 2014/11/05 18:55:43 roberto Exp roberto $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -546,7 +546,7 @@ static void push_onecapture (MatchState *ms, int i, const char *s,
if (i == 0) /* ms->level == 0, too */
lua_pushlstring(ms->L, s, e - s); /* add whole match */
else
- luaL_error(ms->L, "invalid capture index");
+ luaL_error(ms->L, "invalid capture index %%%d", i + 1);
}
else {
ptrdiff_t l = ms->capture[i].len;
@@ -1283,8 +1283,7 @@ static lua_Integer unpackint (lua_State *L, const char *str,
int mask = (!issigned || (lua_Integer)res >= 0) ? 0 : MC;
for (i = limit; i < size; i++) {
if ((unsigned char)str[islittle ? i : size - 1 - i] != mask)
- luaL_error(L, "%d-bit integer does not fit into Lua Integer",
- size * NB);
+ luaL_error(L, "%d-byte integer does not fit into Lua Integer", size);
}
}
return (lua_Integer)res;