diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-08-12 21:16:37 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-08-13 12:42:21 +0200 |
commit | dd09af34b791def2ef370232922d968f5176d1e1 (patch) | |
tree | e85df427a2c28c8b1ed0cb435efc4006e85c2516 /fiv.c | |
parent | dcbc8a90b4caee1f57d185ef47d44818e67711f5 (diff) | |
download | fiv-dd09af34b791def2ef370232922d968f5176d1e1.tar.gz fiv-dd09af34b791def2ef370232922d968f5176d1e1.tar.xz fiv-dd09af34b791def2ef370232922d968f5176d1e1.zip |
Make binaries say what git commit they come from
The manual skipping of the initial "v" from tag names is unfortunate,
but still a bit better than further cluttering up the build system.
Diffstat (limited to 'fiv.c')
-rw-r--r-- | fiv.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -450,8 +450,12 @@ show_about_dialog(GtkWidget *parent) // The rest is approximately copying GTK+'s own gtkaboutdialog.ui. GtkWidget *name = gtk_label_new(NULL); gtk_label_set_selectable(GTK_LABEL(name), TRUE); - gtk_label_set_markup( - GTK_LABEL(name), "<b>" PROJECT_NAME "</b> " PROJECT_VERSION); + + const char *version = PROJECT_VERSION; + gchar *markup = g_strdup_printf( + "<b>%s</b> %s", PROJECT_NAME, &version[*version == 'v']); + gtk_label_set_markup(GTK_LABEL(name), markup); + g_free(markup); GtkWidget *website = gtk_label_new(NULL); gtk_label_set_selectable(GTK_LABEL(website), TRUE); @@ -2005,7 +2009,8 @@ main(int argc, char *argv[]) gboolean initialized = gtk_init_with_args( &argc, &argv, " - Image browser and viewer", options, NULL, &error); if (show_version) { - printf(PROJECT_NAME " " PROJECT_VERSION "\n"); + const char *version = PROJECT_VERSION; + printf("%s %s\n", PROJECT_NAME, &version[*version == 'v']); return 0; } if (show_supported_media_types) { |