mirror of
https://github.com/swaywm/sway.git
synced 2024-11-28 02:41:28 +00:00
swaybar: Fix multiple line on startup
Fix regression on swaybar displaying multiple lines from the
status_command introduced by 315b2bf
.
This commit is contained in:
parent
f2b6d1ec29
commit
3956833f49
|
@ -115,6 +115,14 @@ bool status_handle_readable(struct status_line *status) {
|
|||
sway_log(SWAY_DEBUG, "Using text protocol.");
|
||||
status->protocol = PROTOCOL_TEXT;
|
||||
status->text = status->buffer;
|
||||
newline = strrchr(status->buffer, '\n');
|
||||
if (newline != NULL && newline[1] == '\0') {
|
||||
newline[0] = '\0';
|
||||
newline = strrchr(status->buffer, '\n');
|
||||
}
|
||||
if (newline != NULL) {
|
||||
memmove(status->buffer, newline + 1, strlen(newline + 1) + 1);
|
||||
}
|
||||
// intentional fall-through
|
||||
case PROTOCOL_TEXT:
|
||||
errno = 0;
|
||||
|
|
Loading…
Reference in a new issue