neocgit

a more 'modern' version of cgit
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/neocgit

commit f77e2a8cfaf07b25ddedd57348a1d957b048bbf5
parent 6f2e4400faebd829f905c824400f933fe07f5c30
Author: Christian Hesse <mail@eworm.de>
Date:   Fri,  9 Oct 2015 13:15:50 +0200

ui-shared: return value of cgit_hosturl is not const

Signed-off-by: Christian Hesse <mail@eworm.de>

Diffstat:
Mui-shared.c | 6+++---
Mui-shared.h | 2+-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ui-shared.c b/ui-shared.c @@ -54,14 +54,14 @@ const char *cgit_httpscheme(void) return "http://"; } -const char *cgit_hosturl(void) +char *cgit_hosturl(void) { if (ctx.env.http_host) - return ctx.env.http_host; + return xstrdup(ctx.env.http_host); if (!ctx.env.server_name) return NULL; if (!ctx.env.server_port || atoi(ctx.env.server_port) == 80) - return ctx.env.server_name; + return xstrdup(ctx.env.server_name); return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port); } diff --git a/ui-shared.h b/ui-shared.h @@ -2,7 +2,7 @@ #define UI_SHARED_H extern const char *cgit_httpscheme(); -extern const char *cgit_hosturl(); +extern char *cgit_hosturl(); extern const char *cgit_rooturl(); extern char *cgit_currenturl(); extern const char *cgit_loginurl();