| 475 | |
| 476 | |
| 477 | static const char *findfile (lua_State *L, const char *name, |
| 478 | const char *pname, |
| 479 | const char *dirsep) { |
| 480 | const char *path; |
| 481 | lua_getfield(L, lua_upvalueindex(1), pname); |
| 482 | path = lua_tostring(L, -1); |
| 483 | if (path == NULL) |
| 484 | luaL_error(L, "'package.%s' must be a string", pname); |
| 485 | return searchpath(L, name, path, ".", dirsep); |
| 486 | } |
| 487 | |
| 488 | |
| 489 | static int checkload (lua_State *L, int stat, const char *filename) { |
no test coverage detected