about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ui-shared.c6
-rw-r--r--ui-shared.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/ui-shared.c b/ui-shared.c index f6d38de..09c34fd 100644 --- a/ui-shared.c +++ b/ui-shared.c
@@ -54,14 +54,14 @@ const char *cgit_httpscheme(void)
54 return "http://"; 54 return "http://";
55} 55}
56 56
57const char *cgit_hosturl(void) 57char *cgit_hosturl(void)
58{ 58{
59 if (ctx.env.http_host) 59 if (ctx.env.http_host)
60 return ctx.env.http_host; 60 return xstrdup(ctx.env.http_host);
61 if (!ctx.env.server_name) 61 if (!ctx.env.server_name)
62 return NULL; 62 return NULL;
63 if (!ctx.env.server_port || atoi(ctx.env.server_port) == 80) 63 if (!ctx.env.server_port || atoi(ctx.env.server_port) == 80)
64 return ctx.env.server_name; 64 return xstrdup(ctx.env.server_name);
65 return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port); 65 return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port);
66} 66}
67 67
diff --git a/ui-shared.h b/ui-shared.h index 4121416..474e0c5 100644 --- a/ui-shared.h +++ b/ui-shared.h
@@ -2,7 +2,7 @@
2#define UI_SHARED_H 2#define UI_SHARED_H
3 3
4extern const char *cgit_httpscheme(); 4extern const char *cgit_httpscheme();
5extern const char *cgit_hosturl(); 5extern char *cgit_hosturl();
6extern const char *cgit_rooturl(); 6extern const char *cgit_rooturl();
7extern char *cgit_currenturl(); 7extern char *cgit_currenturl();
8extern const char *cgit_loginurl(); 8extern const char *cgit_loginurl();