/* 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.  */
static const char* getnextfilename(char **path, char *end)
/* 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.  */
static const char* getnextfilename(char **path, char *end)
{
    *name = *LUA_PATH_SEP;
    name++;
  }
  sep = strchr(name, *LUA_PATH_SEP);
  if (sep == NULL)
    sep = end;
  *sep = '\0';
  *path = sep;
  return name;
}