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