From 17ad5e2b7933f4a6820192c3717922e2fd10fa1a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 20 Mar 2017 17:06:47 +0100 Subject: [PATCH] xterm_title: simplify if/else chains --- src/xterm_title.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/xterm_title.c b/src/xterm_title.c index 0e993cf..248cfa8 100644 --- a/src/xterm_title.c +++ b/src/xterm_title.c @@ -28,11 +28,14 @@ set_xterm_title(const char *title) /* the current xterm title exists under the WM_NAME property */ /* and can be retrieved with xprop -id $WINDOWID */ - if (options.enable_xterm_title) { - if (g_getenv("WINDOWID")) { - printf("\033]0;%s\033\\", title); - fflush(stdout); - } else - options.enable_xterm_title = FALSE; + if (!options.enable_xterm_title) + return; + + if (g_getenv("WINDOWID") == NULL) { + options.enable_xterm_title = FALSE; + return; } + + printf("\033]0;%s\033\\", title); + fflush(stdout); } -- 2.30.2