From 06ef15955c7d72ea3df3832722a6216a4e6af44c Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 20 Sep 2026 08:19:31 +0000 Subject: [PATCH] Fix session_*_flag format variables which loop over the windows (they should only be false if all windows do not have the flag, not the first one). GitHub issue 5599. --- format.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/format.c b/format.c index d7a9d75b2..393a2ba4e 100644 --- a/format.c +++ b/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.417 2026/09/08 15:42:26 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.418 2026/09/20 08:19:31 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott @@ -2876,10 +2876,10 @@ format_cb_session_activity_flag(struct format_tree *ft) if (ft->s != NULL) { RB_FOREACH(wl, winlinks, &ft->s->windows) { - if (ft->wl->flags & WINLINK_ACTIVITY) + if (wl->flags & WINLINK_ACTIVITY) return (xstrdup("1")); - return (xstrdup("0")); } + return (xstrdup("0")); } return (NULL); } @@ -2894,8 +2894,8 @@ format_cb_session_bell_flag(struct format_tree *ft) RB_FOREACH(wl, winlinks, &ft->s->windows) { if (wl->flags & WINLINK_BELL) return (xstrdup("1")); - return (xstrdup("0")); } + return (xstrdup("0")); } return (NULL); } @@ -2908,10 +2908,10 @@ format_cb_session_silence_flag(struct format_tree *ft) if (ft->s != NULL) { RB_FOREACH(wl, winlinks, &ft->s->windows) { - if (ft->wl->flags & WINLINK_SILENCE) + if (wl->flags & WINLINK_SILENCE) return (xstrdup("1")); - return (xstrdup("0")); } + return (xstrdup("0")); } return (NULL); }