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