-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | cgit.c | 5 | ||||
-rw-r--r-- | html.c | 2 | ||||
-rw-r--r-- | ui-shared.c | 2 |
4 files changed, 7 insertions, 6 deletions
@@ -1,3 +1,3 @@ -CGIT_VERSION = v0.8.3.4 +CGIT_VERSION = v0.8.3.5 CGIT_SCRIPT_NAME = cgit.cgi CGIT_SCRIPT_PATH = /var/www/htdocs/cgit @@ -242,3 +242,3 @@ clean-doc: get-git: - curl $(GIT_URL) | tar -xj && rm -rf git && mv git-$(GIT_VER) git + curl $(GIT_URL) | tar -xjf - && rm -rf git && mv git-$(GIT_VER) git @@ -753,8 +753,9 @@ int main(int argc, const char **argv) /* If virtual-root isn't specified in cgitrc, lets pretend - * that virtual-root equals SCRIPT_NAME. + * that virtual-root equals SCRIPT_NAME, minus any possibly + * trailing slashes. */ if (!ctx.cfg.virtual_root) - ctx.cfg.virtual_root = ctx.cfg.script_name; + ctx.cfg.virtual_root = trim_end(ctx.cfg.script_name, '/'); /* If no url parameter is specified on the querystring, lets @@ -278,5 +278,5 @@ char *convert_query_hexchar(char *txt) d2 = hextoint(*(txt+2)); if (d1<0 || d2<0) { - memmove(txt, txt+3, n-3); + memmove(txt, txt+3, n-2); return txt-1; } else { diff --git a/ui-shared.c b/ui-shared.c index 7efae7a..5aa9119 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -575,5 +575,5 @@ void cgit_print_http_headers(struct cgit_context *ctx) htmlf("Content-Type: %s\n", ctx->page.mimetype); if (ctx->page.size) - htmlf("Content-Length: %ld\n", ctx->page.size); + htmlf("Content-Length: %zd\n", ctx->page.size); if (ctx->page.filename) htmlf("Content-Disposition: inline; filename=\"%s\"\n", |