| 534 | |
| 535 | |
| 536 | static const char *clearbuff (BuffFS *buff) { |
| 537 | lua_State *L = buff->L; |
| 538 | const char *res; |
| 539 | if (luaD_rawrunprotected(L, pushbuff, buff) != LUA_OK) /* errors? */ |
| 540 | res = NULL; /* error message is on the top of the stack */ |
| 541 | else |
| 542 | res = getstr(tsvalue(s2v(L->top.p - 1))); |
| 543 | if (buff->b != buff->space) /* using dynamic buffer? */ |
| 544 | luaM_freearray(L, buff->b, buff->buffsize); /* free it */ |
| 545 | return res; |
| 546 | } |
| 547 | |
| 548 | |
| 549 | static void addstr2buff (BuffFS *buff, const char *str, size_t slen) { |
no test coverage detected