lua_pushvalue(L, 3 + offset); /* iterator function */
uci_push_section(L, s, i - 1);
- if (lua_pcall(L, 1, 0, 0) == 0)
+ if (lua_pcall(L, 1, 1, 0) == 0) {
ret = true;
+ if (lua_isboolean(L, -1) && !lua_toboolean(L, -1))
+ break;
+ }
+ else
+ {
+ lua_error(L);
+ break;
+ }
}
done: