| 508 | |
| 509 | |
| 510 | LUA_API const char *lua_pushstring (lua_State *L, const char *s) { |
| 511 | if (s == NULL) { |
| 512 | lua_pushnil(L); |
| 513 | return NULL; |
| 514 | } |
| 515 | else { |
| 516 | TString *ts; |
| 517 | lua_lock(L); |
| 518 | luaC_checkGC(L); |
| 519 | ts = luaS_new(L, s); |
| 520 | setsvalue2s(L, L->top, ts); |
| 521 | api_incr_top(L); |
| 522 | lua_unlock(L); |
| 523 | return getstr(ts); |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | |
| 528 | LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, |
no test coverage detected