i3blocks icon indicating copy to clipboard operation
i3blocks copied to clipboard

Accept EOF as well as newline to complete line read

Open shreve opened this issue 6 years ago • 1 comments

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.

shreve avatar Sep 20 '19 05:09 shreve

You shall modify sys.c too (at least), to prepare for EAGAIN during a normal operation (...so you can remove that len > 0 hack).

zsugabubus avatar Sep 21 '19 20:09 zsugabubus