Jonathan Gordon wrote:
to limit the distance it has to seek back would it be better to read the smaller of MAX_PATH and buffer_size untill either the buffer is full or we hit a new line? instead of just reading the full buffer size?
In any case, the read_line() inefficiency is not a big deal. It is only used to read config files and stuff, and that isn't really critical.
Linus