| 482 | |
| 483 | |
| 484 | LUA_API const char *lua_pushstring (lua_State *L, const char *s) { |
| 485 | if (s == NULL) { |
| 486 | lua_pushnil(L); |
| 487 | return NULL; |
| 488 | } |
| 489 | else { |
| 490 | TString *ts; |
| 491 | lua_lock(L); |
| 492 | luaC_checkGC(L); |
| 493 | ts = luaS_new(L, s); |
| 494 | setsvalue2s(L, L->top, ts); |
| 495 | api_incr_top(L); |
| 496 | lua_unlock(L); |
| 497 | return getstr(ts); |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | |
| 502 | LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, |
no test coverage detected