| 492 | |
| 493 | |
| 494 | LUA_API const char *lua_pushstring(lua_State *L, const char *s) { |
| 495 | lua_lock(L); |
| 496 | if (s == nullptr) |
| 497 | setnilvalue(L->top); |
| 498 | else { |
| 499 | TString *ts; |
| 500 | luaC_checkGC(L); |
| 501 | ts = luaS_new(L, s); |
| 502 | setsvalue2s(L, L->top, ts); |
| 503 | s = getstr(ts); /* internal copy's address */ |
| 504 | } |
| 505 | api_incr_top(L); |
| 506 | lua_unlock(L); |
| 507 | return s; |
| 508 | } |
| 509 | |
| 510 | |
| 511 | LUA_API const char *lua_pushvfstring(lua_State *L, const char *fmt, |
no test coverage detected