MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / getnextfilename

Function getnextfilename

third-party/lua-5.5.0/src/loadlib.c:441–456  ·  view source on GitHub ↗

** Get the next name in '*path' = 'name1;name2;name3;...', changing ** the ending ';' to '\0' to create a zero-terminated string. Return ** NULL when list ends. */

Source from the content-addressed store, hash-verified

439** NULL when list ends.
440*/
441static const char *getnextfilename (char **path, char *end) {
442 char *sep;
443 char *name = *path;
444 if (name == end)
445 return NULL; /* no more names */
446 else if (*name == '\0') { /* from previous iteration? */
447 *name = *LUA_PATH_SEP; /* restore separator */
448 name++; /* skip it */
449 }
450 sep = strchr(name, *LUA_PATH_SEP); /* find next separator */
451 if (sep == NULL) /* separator not found? */
452 sep = end; /* name goes until the end */
453 *sep = '\0'; /* finish file name */
454 *path = sep; /* will start next search from here */
455 return name;
456}
457
458
459/*

Callers 1

searchpathFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected