MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / compat53_skipcomment

Function compat53_skipcomment

Libs/sol/sol.hpp:3419–3430  ·  view source on GitHub ↗

** reads the first character of file 'f' and skips an optional BOM mark ** in its beginning plus its first line if it starts with '#'. Returns ** true if it skipped the first line. In any case, '*cp' has the ** first "valid" character of the file (after the optional BOM and ** a first-line comment). */

Source from the content-addressed store, hash-verified

3417** a first-line comment).
3418*/
3419static int compat53_skipcomment(compat53_LoadF* lf, int* cp) {
3420 int c = *cp = compat53_skipBOM(lf);
3421 if (c == '#') { /* first line is a comment (Unix exec. file)? */
3422 do { /* skip first line */
3423 c = getc(lf->f);
3424 } while (c != EOF && c != '\n');
3425 *cp = getc(lf->f); /* skip end-of-line, if present */
3426 return 1; /* there was a comment */
3427 }
3428 else
3429 return 0; /* no comment */
3430}
3431
3432COMPAT53_API int luaL_loadfilex(lua_State* L, const char* filename, const char* mode) {
3433 compat53_LoadF lf;

Callers 1

luaL_loadfilexFunction · 0.85

Calls 1

compat53_skipBOMFunction · 0.85

Tested by

no test coverage detected