+
+ /*
+ * If we don't have a trailing newline, it's because the line is simply
+ * too long. Give up. (FIXME: We could instead reallocate the line
+ * buffer and allow arbitrary-length lines).
+ */
+ if (len == 0 || (bufptr[len - 1] != '\n'))
+ return (EOF);