| 516 | */ |
| 517 | #if !defined(ARDUPILOT_BUILD) |
| 518 | static int loadfunc (lua_State *L, const char *filename, const char *modname) { |
| 519 | const char *openfunc; |
| 520 | const char *mark; |
| 521 | modname = luaL_gsub(L, modname, ".", LUA_OFSEP); |
| 522 | mark = strchr(modname, *LUA_IGMARK); |
| 523 | if (mark) { |
| 524 | int stat; |
| 525 | openfunc = lua_pushlstring(L, modname, mark - modname); |
| 526 | openfunc = lua_pushfstring(L, LUA_POF"%s", openfunc); |
| 527 | stat = lookforfunc(L, filename, openfunc); |
| 528 | if (stat != ERRFUNC) return stat; |
| 529 | modname = mark + 1; /* else go ahead and try old-style name */ |
| 530 | } |
| 531 | openfunc = lua_pushfstring(L, LUA_POF"%s", modname); |
| 532 | return lookforfunc(L, filename, openfunc); |
| 533 | } |
| 534 | |
| 535 | |
| 536 | static int searcher_C (lua_State *L) { |
no test coverage detected