Unified · Split
| @@ -54,14 +54,14 @@ const char *cgit_httpscheme(void) · 53 unmodified lines | ||
| 54 | 54 | return "http://"; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | −const char *cgit_hosturl(void) | |
| 57 | +char *cgit_hosturl(void) | |
| 58 | 58 | { |
| 59 | 59 | if (ctx.env.http_host) |
| 60 | − return ctx.env.http_host; | |
| 60 | + return xstrdup(ctx.env.http_host); | |
| 61 | 61 | if (!ctx.env.server_name) |
| 62 | 62 | return NULL; |
| 63 | 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 | 65 | return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port); |
| 66 | 66 | } |
| 67 | 67 | |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | #define UI_SHARED_H |
| 3 | 3 | |
| 4 | 4 | extern const char *cgit_httpscheme(); |
| 5 | −extern const char *cgit_hosturl(); | |
| 5 | +extern char *cgit_hosturl(); | |
| 6 | 6 | extern const char *cgit_rooturl(); |
| 7 | 7 | extern char *cgit_currenturl(); |
| 8 | 8 | extern const char *cgit_loginurl(); |