summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 58422cb)
raw | patch | inline | side by side (parent: 58422cb)
author | Max Kellermann <max.kellermann@gmail.com> | |
Mon, 20 Mar 2017 16:02:00 +0000 (17:02 +0100) | ||
committer | Max Kellermann <max.kellermann@gmail.com> | |
Mon, 20 Mar 2017 16:02:00 +0000 (17:02 +0100) |
src/main.c | patch | blob | history | |
src/xterm_title.c | patch | blob | history | |
src/xterm_title.h | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index d4c5168a251694d539964e9ff70adf82bc6fd545..b67165f144f9eec225a338285ed9c96dcafe6cfd 100644 (file)
--- a/src/main.c
+++ b/src/main.c
static char title[BUFSIZE];
if (strncmp(title, tmp, BUFSIZE)) {
g_strlcpy(title, tmp, BUFSIZE);
- set_xterm_title("%s", title);
+ set_xterm_title(title);
}
}
#endif
diff --git a/src/xterm_title.c b/src/xterm_title.c
index fe03cfde11f80f8751978ea2332c0b24beffee96..0e993cf3b2d022f163103b787c2c4843f9d15e3f 100644 (file)
--- a/src/xterm_title.c
+++ b/src/xterm_title.c
#include "xterm_title.h"
#include "options.h"
-#include <glib.h>
-
#include <stdio.h>
void
-set_xterm_title(const char *format, ...)
+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")) {
- va_list ap;
- va_start(ap,format);
- char *msg = g_strdup_vprintf(format,ap);
- va_end(ap);
- printf("\033]0;%s\033\\", msg);
+ printf("\033]0;%s\033\\", title);
fflush(stdout);
- g_free(msg);
} else
options.enable_xterm_title = FALSE;
}
diff --git a/src/xterm_title.h b/src/xterm_title.h
index 28addd5c1fdfdece802accdbe1d20ffb6b91ae68..d850f5c0fcd2f0410d586bb1624e45f28e1f585d 100644 (file)
--- a/src/xterm_title.h
+++ b/src/xterm_title.h
#define XTERM_TITLE_H
void
-set_xterm_title(const char *format, ...);
+set_xterm_title(const char *title);
#endif