| 13180 | |
| 13181 | |
| 13182 | static int loader_Croot (lua_State *L) { |
| 13183 | const char *funcname; |
| 13184 | const char *filename; |
| 13185 | const char *name = luaL_checkstring(L, 1); |
| 13186 | const char *p = strchr(name, '.'); |
| 13187 | int stat; |
| 13188 | if (p == NULL) return 0; /* is root */ |
| 13189 | lua_pushlstring(L, name, p - name); |
| 13190 | filename = findfile(L, lua_tostring(L, -1), "cpath"); |
| 13191 | if (filename == NULL) return 1; /* root not found */ |
| 13192 | funcname = mkfuncname(L, name); |
| 13193 | if ((stat = ll_loadfunc(L, filename, funcname)) != 0) { |
| 13194 | if (stat != ERRFUNC) loaderror(L, filename); /* real error */ |
| 13195 | lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS, |
| 13196 | name, filename); |
| 13197 | return 1; /* function not found */ |
| 13198 | } |
| 13199 | return 1; |
| 13200 | } |
| 13201 | |
| 13202 | |
| 13203 | static int loader_preload (lua_State *L) { |
nothing calls this directly
no test coverage detected