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

Function skipcomment

third-party/lua-5.5.0/src/lauxlib.c:795–805  ·  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

793** a first-line comment).
794*/
795static int skipcomment (FILE *f, int *cp) {
796 int c = *cp = skipBOM(f);
797 if (c == '#') { /* first line is a comment (Unix exec. file)? */
798 do { /* skip first line */
799 c = getc(f);
800 } while (c != EOF && c != '\n');
801 *cp = getc(f); /* next character after comment, if present */
802 return 1; /* there was a comment */
803 }
804 else return 0; /* no comment */
805}
806
807
808LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename,

Callers 1

luaL_loadfilexFunction · 0.70

Calls 1

skipBOMFunction · 0.70

Tested by

no test coverage detected