diff options
Diffstat (limited to 'lstrlib.c')
-rw-r--r-- | lstrlib.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.18 1998/07/01 14:21:57 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.19 1998/07/12 16:13:45 roberto Exp roberto $ |
3 | ** Standard library for strings and pattern-matching | 3 | ** Standard library for strings and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -138,8 +138,11 @@ struct Capture { | |||
138 | static void push_captures (struct Capture *cap) | 138 | static void push_captures (struct Capture *cap) |
139 | { | 139 | { |
140 | int i; | 140 | int i; |
141 | for (i=0; i<cap->level; i++) | 141 | for (i=0; i<cap->level; i++) { |
142 | lua_pushlstring(cap->capture[i].init, cap->capture[i].len); | 142 | int l = cap->capture[i].len; |
143 | if (l == -1) lua_error("unfinished capture"); | ||
144 | lua_pushlstring(cap->capture[i].init, l); | ||
145 | } | ||
143 | } | 146 | } |
144 | 147 | ||
145 | 148 | ||