| 424 | |
| 425 | |
| 426 | static int ll_searchpath(lua_State *L) { |
| 427 | const char *f = searchpath(L, luaL_checkstring(L, 1), |
| 428 | luaL_checkstring(L, 2), |
| 429 | luaL_optstring(L, 3, "."), |
| 430 | luaL_optstring(L, 4, LUA_DIRSEP)); |
| 431 | if (f != nullptr) return 1; |
| 432 | else { /* error message is on top of the stack */ |
| 433 | lua_pushnil(L); |
| 434 | lua_insert(L, -2); |
| 435 | return 2; /* return nil + error message */ |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | |
| 440 | static const char *findfile(lua_State *L, const char *name, |
nothing calls this directly
no test coverage detected