MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / skipBOM

Function skipBOM

3rd/lua-5.4.3/src/lauxlib.c:742–753  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

740
741
742static int skipBOM (LoadF *lf) {
743 const char *p = "\xEF\xBB\xBF"; /* UTF-8 BOM mark */
744 int c;
745 lf->n = 0;
746 do {
747 c = getc(lf->f);
748 if (c == EOF || c != *(const unsigned char *)p++) return c;
749 lf->buff[lf->n++] = c; /* to be read by the parser */
750 } while (*p != '\0');
751 lf->n = 0; /* prefix matched; discard it */
752 return getc(lf->f); /* return next character */
753}
754
755
756/*

Callers 1

skipcommentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected