diff --git a/Makefile.am b/Makefile.am index 6902477e..082a467c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,8 +11,9 @@ EXTRA_DIST = \ dist_EXTRA_tmux_SOURCES = compat/*.[ch] # Preprocessor flags. -AM_CPPFLAGS += @XOPEN_DEFINES@ -AM_CPPFLAGS += -DTMUX_CONF="\"$(sysconfdir)/tmux.conf:~/.tmux.conf:~/.config/tmux/tmux.conf\"" +AM_CPPFLAGS += @XOPEN_DEFINES@ \ + -DTMUX_VERSION="\"@VERSION@\"" \ + -DTMUX_CONF="\"$(sysconfdir)/tmux.conf:~/.tmux.conf:~/.config/tmux/tmux.conf\"" # Additional object files. LDADD = $(LIBOBJS) diff --git a/input.c b/input.c index 452eac7f..a2c63e14 100644 --- a/input.c +++ b/input.c @@ -20,6 +20,7 @@ #include +#include #include #include #include diff --git a/tmux.c b/tmux.c index b5cdfbf9..3c1feccc 100644 --- a/tmux.c +++ b/tmux.c @@ -213,15 +213,7 @@ find_home(void) const char * getversion(void) { - static char *version; - struct utsname u; - - if (version == NULL) { - if (uname(&u) < 0) - fatalx("uname failed"); - xasprintf(&version, "openbsd-%s", u.release); - } - return version; + return TMUX_VERSION; } int @@ -264,9 +256,6 @@ main(int argc, char **argv) else flags |= CLIENT_CONTROL; break; - case 'V': - printf("%s %s\n", getprogname(), VERSION); - exit(0); case 'f': set_cfg_file(optarg); break;