From mboxrd@z Thu Jan 1 00:00:00 1970 From: john at keeping.me.uk (John Keeping) Date: Sat, 16 Jun 2018 17:25:20 +0100 Subject: [PATCH] expand environmentvariables in root-title and root-descr In-Reply-To: <20180412091912.11486-1-b.laessig@pengutronix.de> References: <20180412091912.11486-1-b.laessig@pengutronix.de> Message-ID: <20180616162519.GD1922@john.keeping.me.uk> On Thu, Apr 12, 2018 at 11:19:12AM +0200, b.laessig at pengutronix.de wrote: > From: Bj?rn L?ssig > > For having personanlized cgit configuration i need to use > > root-desc=$REMOTE_USER@$HTTP_HOST Missing sign-off (see [1] for what this means). Also, this needs a corresponding change in cgitrc.5.txt to indicate that these variables are now subject to macro expansion. [1] https://elinux.org/Developer_Certificate_Of_Origin > --- > cgit.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/cgit.c b/cgit.c > index bd9cb3f..1d7d67e 100644 > --- a/cgit.c > +++ b/cgit.c > @@ -120,9 +120,9 @@ static void config_cb(const char *name, const char *value) > else if (!strcmp(name, "readme")) > string_list_append(&ctx.cfg.readme, xstrdup(value)); > else if (!strcmp(name, "root-title")) > - ctx.cfg.root_title = xstrdup(value); > + ctx.cfg.root_title = xstrdup(expand_macros(value)); > else if (!strcmp(name, "root-desc")) > - ctx.cfg.root_desc = xstrdup(value); > + ctx.cfg.root_desc = xstrdup(expand_macros(value)); > else if (!strcmp(name, "root-readme")) > ctx.cfg.root_readme = xstrdup(value); > else if (!strcmp(name, "css")) > -- > 2.11.0