From 0001a66253069a7215b833ce017e032306ab9b9b Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Wed, 28 Jan 2015 09:33:38 +0100 Subject: [PATCH] Allow substitutions like $short_name in "Title image" option --- src/elogd.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 4bb652f5..9d69c27e 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -7931,9 +7931,10 @@ void add_logbook_to_group(LOGBOOK * lbs, char *new_name) void show_standard_title(LOGBOOK * lbs, char *text, int printable) { - char str[256], ref[256], sclass[32], comment[256], full_name[256], url[256], logbook[256]; + char str[NAME_LENGTH], ref[256], sclass[32], comment[256], full_name[256], url[256], logbook[256]; int i, j, level; LBLIST phier, pnode, pnext, flb; + char slist[20][NAME_LENGTH], svalue[20][NAME_LENGTH]; if (lbs == NULL) strlcpy(logbook, "global", sizeof(logbook)); @@ -8084,11 +8085,15 @@ void show_standard_title(LOGBOOK * lbs, char *text, int printable) if (getcfg(logbook, "Title image URL", str, sizeof(str))) rsprintf("\n", str); - if (getcfg(logbook, "Title image", str, sizeof(str))) - rsprintf("%s", str); - else - rsprintf("\"ELOG"); + if (getcfg(logbook, "Title image", str, sizeof(str))) { + // allow $short_name for example to link to personal pictures + i = build_subst_list(lbs, slist, svalue, NULL, TRUE); + strsubst_list(str, sizeof(str), slist, svalue, i); + rsprintf("%s", str); + } else + rsprintf("\"ELOG"); + if (getcfg(logbook, "Title image URL", str, sizeof(str))) rsprintf("\n");