summaryrefslogtreecommitdiff
path: root/lpcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'lpcap.c')
-rw-r--r--lpcap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lpcap.c b/lpcap.c
index 1c2af0b..b332fde 100644
--- a/lpcap.c
+++ b/lpcap.c
@@ -271,15 +271,15 @@ int finddyncap (Capture *cap, Capture *last) {
271 271
272 272
273/* 273/*
274** Calls a runtime capture. Returns number of captures removed by 274** Calls a runtime capture. Returns number of captures "removed" by the
275** the call, including the initial Cgroup. (Captures to be added are 275** call, that is, those inside the group capture. Captures to be added
276** on the Lua stack.) 276** are on the Lua stack.
277*/ 277*/
278int runtimecap (CapState *cs, Capture *close, const char *s, int *rem) { 278int runtimecap (CapState *cs, Capture *close, const char *s, int *rem) {
279 int n, id; 279 int n, id;
280 lua_State *L = cs->L; 280 lua_State *L = cs->L;
281 int otop = lua_gettop(L); 281 int otop = lua_gettop(L);
282 Capture *open = findopen(close); 282 Capture *open = findopen(close); /* get open group capture */
283 assert(captype(open) == Cgroup); 283 assert(captype(open) == Cgroup);
284 id = finddyncap(open, close); /* get first dynamic capture argument */ 284 id = finddyncap(open, close); /* get first dynamic capture argument */
285 close->kind = Cclose; /* closes the group */ 285 close->kind = Cclose; /* closes the group */
@@ -299,7 +299,7 @@ int runtimecap (CapState *cs, Capture *close, const char *s, int *rem) {
299 } 299 }
300 else 300 else
301 *rem = 0; /* no dynamic captures removed */ 301 *rem = 0; /* no dynamic captures removed */
302 return close - open; /* number of captures of all kinds removed */ 302 return close - open - 1; /* number of captures to be removed */
303} 303}
304 304
305 305