diff --git a/src/xterm_title.c b/src/xterm_title.c
index 0e993cf3b2d022f163103b787c2c4843f9d15e3f..cc4754a3383505f72d0b5b73cbf85be29acc8ab8 100644 (file)
--- a/src/xterm_title.c
+++ b/src/xterm_title.c
#include "options.h"
#include <stdio.h>
+#include <stdlib.h>
void
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 (getenv("WINDOWID") == NULL) {
+ options.enable_xterm_title = FALSE;
+ return;
}
+
+ printf("\033]0;%s\033\\", title);
+ fflush(stdout);
}