mirror of
https://git.zx2c4.com/cgit
synced 2024-11-22 16:38:42 +00:00
ui-shared: return value of cgit_hosturl is not const
Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
parent
6f2e4400fa
commit
f77e2a8cfa
@ -54,14 +54,14 @@ const char *cgit_httpscheme(void)
|
|||||||
return "http://";
|
return "http://";
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *cgit_hosturl(void)
|
char *cgit_hosturl(void)
|
||||||
{
|
{
|
||||||
if (ctx.env.http_host)
|
if (ctx.env.http_host)
|
||||||
return ctx.env.http_host;
|
return xstrdup(ctx.env.http_host);
|
||||||
if (!ctx.env.server_name)
|
if (!ctx.env.server_name)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!ctx.env.server_port || atoi(ctx.env.server_port) == 80)
|
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);
|
return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define UI_SHARED_H
|
#define UI_SHARED_H
|
||||||
|
|
||||||
extern const char *cgit_httpscheme();
|
extern const char *cgit_httpscheme();
|
||||||
extern const char *cgit_hosturl();
|
extern char *cgit_hosturl();
|
||||||
extern const char *cgit_rooturl();
|
extern const char *cgit_rooturl();
|
||||||
extern char *cgit_currenturl();
|
extern char *cgit_currenturl();
|
||||||
extern const char *cgit_loginurl();
|
extern const char *cgit_loginurl();
|
||||||
|
Loading…
Reference in New Issue
Block a user