| 388 | |
| 389 | |
| 390 | static const char *pushnexttemplate(lua_State *L, const char *path) { |
| 391 | const char *l; |
| 392 | while (*path == *LUA_PATH_SEP) path++; /* skip separators */ |
| 393 | if (*path == '\0') return nullptr; /* no more templates */ |
| 394 | l = strchr(path, *LUA_PATH_SEP); /* find next separator */ |
| 395 | if (l == nullptr) l = path + strlen(path); |
| 396 | lua_pushlstring(L, path, l - path); /* template */ |
| 397 | return l; |
| 398 | } |
| 399 | |
| 400 | |
| 401 | static const char *searchpath(lua_State *L, const char *name, |
no test coverage detected