aboutsummaryrefslogtreecommitdiff
path: root/lstrlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-08-29 17:43:28 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-08-29 17:43:28 -0300
commita97f29f15487c5f584185f646f9cfc06a04b26ca (patch)
treee7ffd959fb80f9622d74a2efadfd7880037d64ca /lstrlib.c
parent4135f4f5862b57d9dbf3e9b7c6507f5c86516327 (diff)
downloadlua-a97f29f15487c5f584185f646f9cfc06a04b26ca.tar.gz
lua-a97f29f15487c5f584185f646f9cfc06a04b26ca.tar.bz2
lua-a97f29f15487c5f584185f646f9cfc06a04b26ca.zip
explicit stack control in the API
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lstrlib.c b/lstrlib.c
index c380359b..0a0a6c13 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.46 2000/08/09 19:16:57 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.47 2000/08/28 17:57:04 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*/
@@ -400,6 +400,7 @@ static const char *lmemfind (const char *s1, size_t l1,
400 400
401static int push_captures (lua_State *L, struct Capture *cap) { 401static int push_captures (lua_State *L, struct Capture *cap) {
402 int i; 402 int i;
403 luaL_checkstack(L, cap->level, "too many captures");
403 for (i=0; i<cap->level; i++) { 404 for (i=0; i<cap->level; i++) {
404 int l = cap->capture[i].len; 405 int l = cap->capture[i].len;
405 if (l == -1) lua_error(L, "unfinished capture"); 406 if (l == -1) lua_error(L, "unfinished capture");