History

ui-shared: return value of cgit_hosturl is not const

Christian Hesse committed 11 years ago

Commit f77e2a81 parent 6f2e4402 files · +4 −4Browse files

Unified · Split

2 files
  1. ui-shared.c +3 −3
  2. ui-shared.h +1 −1
ui-shared.c+3−3
@@ -54,14 +54,14 @@ const char *cgit_httpscheme(void) · 53 unmodified lines
5454 return "http://";
5555 }
5656
57−const char *cgit_hosturl(void)
57+char *cgit_hosturl(void)
5858 {
5959 if (ctx.env.http_host)
60− return ctx.env.http_host;
60+ return xstrdup(ctx.env.http_host);
6161 if (!ctx.env.server_name)
6262 return NULL;
6363 if (!ctx.env.server_port || atoi(ctx.env.server_port) == 80)
64− return ctx.env.server_name;
64+ return xstrdup(ctx.env.server_name);
6565 return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port);
6666 }
6767
ui-shared.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 #define UI_SHARED_H
33
44 extern const char *cgit_httpscheme();
5−extern const char *cgit_hosturl();
5+extern char *cgit_hosturl();
66 extern const char *cgit_rooturl();
77 extern char *cgit_currenturl();
88 extern const char *cgit_loginurl();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t