| 527 | |
| 528 | |
| 529 | static const char *getF (lua_State *L, void *ud, size_t *size) { |
| 530 | LoadF *lf = (LoadF *)ud; |
| 531 | (void)L; |
| 532 | if (lf->extraline) { |
| 533 | lf->extraline = 0; |
| 534 | *size = 1; |
| 535 | return "\n"; |
| 536 | } |
| 537 | if (feof(lf->f)) return NULL; |
| 538 | *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f); |
| 539 | return (*size > 0) ? lf->buff : NULL; |
| 540 | } |
| 541 | |
| 542 | |
| 543 | static int errfile (lua_State *L, const char *what, int fnameindex) { |