| 14688 | |
| 14689 | |
| 14690 | static int tconcat (lua_State *L) { |
| 14691 | luaL_Buffer b; |
| 14692 | size_t lsep; |
| 14693 | int i, last; |
| 14694 | const char *sep = luaL_optlstring(L, 2, "", &lsep); |
| 14695 | luaL_checktype(L, 1, LUA_TTABLE); |
| 14696 | i = luaL_optint(L, 3, 1); |
| 14697 | last = luaL_opt(L, luaL_checkint, 4, luaL_getn(L, 1)); |
| 14698 | luaL_buffinit(L, &b); |
| 14699 | for (; i < last; i++) { |
| 14700 | addfield(L, &b, i); |
| 14701 | luaL_addlstring(&b, sep, lsep); |
| 14702 | } |
| 14703 | if (i == last) /* add last value (if interval was not empty) */ |
| 14704 | addfield(L, &b, i); |
| 14705 | luaL_pushresult(&b); |
| 14706 | return 1; |
| 14707 | } |
| 14708 | |
| 14709 | |
| 14710 |
nothing calls this directly
no test coverage detected