| 530 | |
| 531 | |
| 532 | LUA_API const char *lua_pushstring (lua_State *L, const char *s) { |
| 533 | lua_lock(L); |
| 534 | if (s == NULL) |
| 535 | setnilvalue(s2v(L->top)); |
| 536 | else { |
| 537 | TString *ts; |
| 538 | ts = luaS_new(L, s); |
| 539 | setsvalue2s(L, L->top, ts); |
| 540 | s = getstr(ts); /* internal copy's address */ |
| 541 | } |
| 542 | api_incr_top(L); |
| 543 | luaC_checkGC(L); |
| 544 | lua_unlock(L); |
| 545 | return s; |
| 546 | } |
| 547 | |
| 548 | |
| 549 | LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, |
no test coverage detected