From eb9357709bfd521a87f5fc4232bf37ce360a0317 Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Fri, 14 Mar 2025 20:15:11 +0000 Subject: main/client: simplify code for printing --version string --- main.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 7e07038f..b9404503 100644 --- a/main.c +++ b/main.c @@ -31,7 +31,6 @@ #include "shm.h" #include "terminal.h" #include "util.h" -#include "version.h" #include "xmalloc.h" #include "xsnprintf.h" @@ -46,20 +45,6 @@ fdm_sigint(struct fdm *fdm, int signo, void *data) return true; } -static const char * -version_and_features(void) -{ - static char buf[256]; - snprintf(buf, sizeof(buf), - "version: %s %cpgo %cime %cgraphemes %cassertions", - FOOT_VERSION, - feature_pgo() ? '+' : '-', - feature_ime() ? '+' : '-', - feature_graphemes() ? '+' : '-', - feature_assertions() ? '+' : '-'); - return buf; -} - static void print_usage(const char *prog_name) { @@ -377,7 +362,7 @@ main(int argc, char *const *argv) break; case 'v': - printf("foot %s\n", version_and_features()); + print_version_and_features("foot "); return EXIT_SUCCESS; case 'h': @@ -405,7 +390,7 @@ main(int argc, char *const *argv) argv += optind; } - LOG_INFO("%s", version_and_features()); + LOG_INFO("%s", version_and_features); { struct utsname name; -- cgit v1.3