This commit is contained in:
Hinara 2023-09-20 20:32:50 +09:00 committed by GitHub
commit 6a028e4e45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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:
while (true) {