** Push given string to the stack, as part of the result, and ** join it to previous partial result if there is one. ** It may call 'luaV_concat' while using one slot from EXTRA_STACK. ** This call cannot invoke metamethods, as both operands must be ** strings. It can, however, raise an error if the result is too ** long. In that case, 'luaV_concat' frees the extra slot before ** raising the error
| 412 | ** raising the error. |
| 413 | */ |
| 414 | static void pushstr (BuffFS *buff, const char *str, size_t lstr) { |
| 415 | lua_State *L = buff->L; |
| 416 | setsvalue2s(L, L->top.p, luaS_newlstr(L, str, lstr)); |
| 417 | L->top.p++; /* may use one slot from EXTRA_STACK */ |
| 418 | if (!buff->pushed) /* no previous string on the stack? */ |
| 419 | buff->pushed = 1; /* now there is one */ |
| 420 | else /* join previous string with new one */ |
| 421 | luaV_concat(L, 2); |
| 422 | } |
| 423 | |
| 424 | |
| 425 | /* |
no test coverage detected