i3blocks
i3blocks copied to clipboard
Accept EOF as well as newline to complete line read
Addresses #393 and #403.
Currently a line isn't read if any error is reached, including EAGAIN, which indicates you've reached the end of a file descriptor.
This commit allows EAGAIN to terminate a line if anything else has been read from that fd. If nothing else has been read, it's either non-existent or empty, which makes sense to error instead.
You shall modify sys.c too (at least), to prepare for EAGAIN during a normal operation (...so you can remove that len > 0 hack).