- while (fgets(line,MAXPATHLEN,f)) {
- int l = strlen(line);
- if (l && line[l-1] == '\n') l--;
- line[l] = 0;
- if (line[0] && (line[0] != ';') && (line[0] != '#')) {
+ while (1) {
+ char ch, *s = line;
+ int cnt;
+ while (1) {
+ if ((cnt = read(fd, &ch, 1)) <= 0) {
+ if (cnt < 0 && errno == EINTR)
+ continue;
+ break;
+ }
+ if (eol_nulls? !ch : (ch == '\n' || ch == '\r'))
+ break;
+ if (s < eob)
+ *s++ = ch;
+ }
+ *s = '\0';
+ if (*line && *line != ';' && *line != '#') {