** reads the first character of file 'f' and skips an optional BOM mark ** in its beginning plus its first line if it starts with '#'. Returns ** true if it skipped the first line. In any case, '*cp' has the ** first "valid" character of the file (after the optional BOM and ** a first-line comment). */
| 769 | ** a first-line comment). |
| 770 | */ |
| 771 | static int skipcomment (FILE *f, int *cp) { |
| 772 | int c = *cp = skipBOM(f); |
| 773 | if (c == '#') { /* first line is a comment (Unix exec. file)? */ |
| 774 | do { /* skip first line */ |
| 775 | c = getc(f); |
| 776 | } while (c != EOF && c != '\n'); |
| 777 | *cp = getc(f); /* next character after comment, if present */ |
| 778 | return 1; /* there was a comment */ |
| 779 | } |
| 780 | else return 0; /* no comment */ |
| 781 | } |
| 782 | |
| 783 | |
| 784 | LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename, |
no test coverage detected