forked from RepoMirrors/bemenu
bemenu: Do not eat newlines
This commit is contained in:
parent
208af51c0e
commit
7b8b38bc21
@ -42,13 +42,8 @@ read_items_to_menu_from_stdin(struct bm_menu *menu)
|
||||
buffer[allocated - step + read - 1] = 0;
|
||||
|
||||
char *s = buffer;
|
||||
while ((size_t)(s - buffer) < allocated - step + read) {
|
||||
while ((size_t)(s - buffer) < allocated - step + read && *s != 0) {
|
||||
size_t pos = strcspn(s, "\n");
|
||||
if (pos == 0) {
|
||||
s += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
s[pos] = 0;
|
||||
|
||||
struct bm_item *item;
|
||||
|
Loading…
Reference in New Issue
Block a user