| 338 | |
| 339 | |
| 340 | static const char *pushnexttemplate (lua_State *L, const char *path) { |
| 341 | const char *l; |
| 342 | while (*path == *LUA_PATHSEP) path++; /* skip separators */ |
| 343 | if (*path == '\0') return NULL; /* no more templates */ |
| 344 | l = strchr(path, *LUA_PATHSEP); /* find next separator */ |
| 345 | if (l == NULL) l = path + strlen(path); |
| 346 | lua_pushlstring(L, path, l - path); /* template */ |
| 347 | return l; |
| 348 | } |
| 349 | |
| 350 | |
| 351 | static const char *findfile (lua_State *L, const char *name, |
no test coverage detected