container: Skip % char if it doesn't match a view property

The else condition was missed here and we would never skip the % char
if it didn't end up matching with any property. Since we fail to skip
we would re-evaluate the % in an infinite loop never achieving any
forward-progress.

Fixes: https://github.com/swaywm/sway/issues/8333
(cherry picked from commit fc6b8d6af2)
This commit is contained in:
Alexander Orzechowski 2024-09-06 19:09:41 -04:00 committed by Simon Ser
parent 7246bf909c
commit 31ce4ea53d

View file

@ -714,6 +714,10 @@ size_t parse_title_format(struct sway_container *container, char *buffer) {
} else if (strncmp(next, "%shell", 6) == 0) { } else if (strncmp(next, "%shell", 6) == 0) {
len += append_prop(buffer, view_get_shell(container->view)); len += append_prop(buffer, view_get_shell(container->view));
format += 6; format += 6;
} else {
lenient_strcat(buffer, "%");
++format;
++len;
} }
} else { } else {
lenient_strcat(buffer, "%"); lenient_strcat(buffer, "%");