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

Function skipBOM

third-party/lua-5.5.0/src/lauxlib.c:779–785  ·  view source on GitHub ↗

** Skip an optional BOM at the start of a stream. If there is an ** incomplete BOM (the first character is correct but the rest is ** not), returns the first character anyway to force an error ** (as no chunk can start with 0xEF). */

Source from the content-addressed store, hash-verified

777** (as no chunk can start with 0xEF).
778*/
779static int skipBOM (FILE *f) {
780 int c = getc(f); /* read first character */
781 if (c == 0xEF && getc(f) == 0xBB && getc(f) == 0xBF) /* correct BOM? */
782 return getc(f); /* ignore BOM and return next char */
783 else /* no (valid) BOM */
784 return c; /* return first character */
785}
786
787
788/*

Callers 1

skipcommentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected