bemenu/client
Sören Tempel 1475c3ce45 client: improve stripping of getline(3) newline
The previous version of this code operated under the assumption that
getline(3) lines are always \n\0 terminated. Unfortunately, this is not
the case as readline will return input which is not terminated with a
newline character if EOF is reached before encountering this newline. In
these cases, the code would falsely strip the last character. As an
example, consider the following bemenu invocation:

	printf foo | ./bemenu

This would start bemenu with `fo` instead of `foo` as a menu item. This
commit fixes this edge case and also hardens the loop body a bit by only
entering it if getline wrote more than zero characters to the buffer.
2021-04-04 19:03:52 +09:00
..
common Use -m option for setting monitor name and monitor + cleanup 2021-02-05 16:53:43 +09:00
bemenu-run.c Add no-exec option to bemenu-run 2020-02-23 01:41:50 +09:00
bemenu.c client: improve stripping of getline(3) newline 2021-04-04 19:03:52 +09:00