| 520 | |
| 521 | |
| 522 | static const char *findfile (lua_State *L, const char *name, |
| 523 | const char *pname, |
| 524 | const char *dirsep) { |
| 525 | const char *path; |
| 526 | lua_getfield(L, lua_upvalueindex(1), pname); |
| 527 | path = lua_tostring(L, -1); |
| 528 | if (l_unlikely(path == NULL)) |
| 529 | luaL_error(L, "'package.%s' must be a string", pname); |
| 530 | return searchpath(L, name, path, ".", dirsep); |
| 531 | } |
| 532 | |
| 533 | |
| 534 | static int checkload (lua_State *L, int stat, const char *filename) { |
no test coverage detected