From: Max Kellermann Date: Mon, 20 Mar 2017 16:06:47 +0000 (+0100) Subject: xterm_title: simplify if/else chains X-Git-Tag: v0.27~38 X-Git-Url: https://git.tokkee.org/?p=ncmpc.git;a=commitdiff_plain;h=17ad5e2b7933f4a6820192c3717922e2fd10fa1a xterm_title: simplify if/else chains --- 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); }