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

Function skipBOM

third-party/lua-5.3.5/src/lauxlib.c:669–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

667
668
669static int skipBOM (LoadF *lf) {
670 const char *p = "\xEF\xBB\xBF"; /* UTF-8 BOM mark */
671 int c;
672 lf->n = 0;
673 do {
674 c = getc(lf->f);
675 if (c == EOF || c != *(const unsigned char *)p++) return c;
676 lf->buff[lf->n++] = c; /* to be read by the parser */
677 } while (*p != '\0');
678 lf->n = 0; /* prefix matched; discard it */
679 return getc(lf->f); /* return next character */
680}
681
682
683/*

Callers 1

skipcommentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected