From 6db46f15f8705b68a34581c40b7618aa8252f0e3 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 21 Dec 2020 14:54:49 +0100
Subject: [PATCH 01/11] display: do not show the state flags in the help viewer
 or file browser

The state flags are relevant only when editing.

This fixes https://savannah.gnu.org/bugs/?59744.
Indirectly-reported-by: ObeliX <ObeliX-@gmx.de>

Bug existed since version 5.3, since --stateflags was introduced.
---
 src/winio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/winio.c b/src/winio.c
index 8a3bfce4..5722d7e6 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2034,7 +2034,7 @@ void titlebar(const char *path)
 #ifndef NANO_TINY
 	/* When requested, show on the title bar the state of three options and
 	 * the state of the mark and whether a macro is being recorded. */
-	if (ISSET(STATEFLAGS) && !ISSET(VIEW_MODE)) {
+	if (*state && ISSET(STATEFLAGS) && !ISSET(VIEW_MODE)) {
 		if (openfile->modified && COLS > 1)
 			waddstr(topwin, " *");
 		if (statelen < COLS) {
-- 
2.29.2

