| 2879 | } |
| 2880 | |
| 2881 | static 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 |
no outgoing calls
no test coverage detected