aboutsummaryrefslogtreecommitdiff
path: root/lstrlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-11-08 16:12:53 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-11-08 16:12:53 -0200
commit74e10b9c3b7bdc5dd1b2fe61149b6244f3d95a03 (patch)
treeefc6c6dd3187b9f4ef6c04aa1da33fc51bb6c361 /lstrlib.c
parentb044b8c1824749d10ffdb0159dcd794da8c29cfe (diff)
downloadlua-74e10b9c3b7bdc5dd1b2fe61149b6244f3d95a03.tar.gz
lua-74e10b9c3b7bdc5dd1b2fe61149b6244f3d95a03.tar.bz2
lua-74e10b9c3b7bdc5dd1b2fe61149b6244f3d95a03.zip
details (error messages)
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lstrlib.c b/lstrlib.c
index d2d05a80..95569ec1 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.214 2014/11/05 18:50:29 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.215 2014/11/05 18:55:43 roberto Exp roberto $
3** Standard library for string operations and pattern-matching 3** Standard library for string operations and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -546,7 +546,7 @@ static void push_onecapture (MatchState *ms, int i, const char *s,
546 if (i == 0) /* ms->level == 0, too */ 546 if (i == 0) /* ms->level == 0, too */
547 lua_pushlstring(ms->L, s, e - s); /* add whole match */ 547 lua_pushlstring(ms->L, s, e - s); /* add whole match */
548 else 548 else
549 luaL_error(ms->L, "invalid capture index"); 549 luaL_error(ms->L, "invalid capture index %%%d", i + 1);
550 } 550 }
551 else { 551 else {
552 ptrdiff_t l = ms->capture[i].len; 552 ptrdiff_t l = ms->capture[i].len;
@@ -1283,8 +1283,7 @@ static lua_Integer unpackint (lua_State *L, const char *str,
1283 int mask = (!issigned || (lua_Integer)res >= 0) ? 0 : MC; 1283 int mask = (!issigned || (lua_Integer)res >= 0) ? 0 : MC;
1284 for (i = limit; i < size; i++) { 1284 for (i = limit; i < size; i++) {
1285 if ((unsigned char)str[islittle ? i : size - 1 - i] != mask) 1285 if ((unsigned char)str[islittle ? i : size - 1 - i] != mask)
1286 luaL_error(L, "%d-bit integer does not fit into Lua Integer", 1286 luaL_error(L, "%d-byte integer does not fit into Lua Integer", size);
1287 size * NB);
1288 } 1287 }
1289 } 1288 }
1290 return (lua_Integer)res; 1289 return (lua_Integer)res;