MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / compat53_skipBOM

Function compat53_skipBOM

extlibs/sol3/include/sol/sol.hpp:2881–2892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2879}
2880
2881static int compat53_skipBOM(compat53_LoadF *lf) {
2882 const char *p = "\xEF\xBB\xBF"; /* UTF-8 BOM mark */
2883 int c;
2884 lf->n = 0;
2885 do {
2886 c = getc(lf->f);
2887 if (c == EOF || c != *(const unsigned char *)p++) return c;
2888 lf->buff[lf->n++] = (char)c; /* to be read by the parser */
2889 } while (*p != '\0');
2890 lf->n = 0; /* prefix matched; discard it */
2891 return getc(lf->f); /* return next character */
2892}
2893
2894/*
2895** reads the first character of file 'f' and skips an optional BOM mark

Callers 1

compat53_skipcommentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected