author | Lars Hjemli <hjemli@gmail.com> | 2011-03-05 13:01:59 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2011-03-05 13:01:59 (UTC) |
commit | 1b09cbd303d889ec2636127584d57b7f1b70c25e (patch) (side-by-side diff) | |
tree | 2b1188f946451d06af4d9120cbc3ba34de716f21 | |
parent | 979c460e7f71d153ae79da67b8b21c3412f0fe02 (diff) | |
parent | 9e849950dc7c1f2fb6ffa62ab65bd30f35717d13 (diff) | |
download | cgit-1b09cbd303d889ec2636127584d57b7f1b70c25e.zip cgit-1b09cbd303d889ec2636127584d57b7f1b70c25e.tar.gz cgit-1b09cbd303d889ec2636127584d57b7f1b70c25e.tar.bz2 |
Merge branch 'stable'
-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,7 +1,7 @@ -CGIT_VERSION = v0.8.3.4 +CGIT_VERSION = v0.8.3.5 CGIT_SCRIPT_NAME = cgit.cgi CGIT_SCRIPT_PATH = /var/www/htdocs/cgit CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH) CGIT_CONFIG = /etc/cgitrc CACHE_ROOT = /var/cache/cgit prefix = /usr @@ -238,7 +238,7 @@ clean: clean-doc rm -f cgit VERSION *.o *.d clean-doc: rm -f cgitrc.5 cgitrc.5.html cgitrc.5.pdf cgitrc.5.xml cgitrc.5.fo 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 @@ -749,16 +749,17 @@ int main(int argc, const char **argv) cgit_parse_args(argc, argv); parse_configfile(expand_macros(ctx.env.cgit_config), config_cb); ctx.repo = NULL; http_parse_querystring(ctx.qry.raw, querystring_cb); /* 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 * use PATH_INFO as url. This allows cgit to work with virtual * urls without the need for rewriterules in the webserver (as * long as PATH_INFO is included in the cache lookup key). */ @@ -274,13 +274,13 @@ char *convert_query_hexchar(char *txt) *txt = '\0'; return txt-1; } d1 = hextoint(*(txt+1)); 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 { *txt = d1 * 16 + d2; memmove(txt+1, txt+3, n-2); return txt; } diff --git a/ui-shared.c b/ui-shared.c index 7efae7a..5aa9119 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -571,13 +571,13 @@ void cgit_print_http_headers(struct cgit_context *ctx) if (ctx->page.mimetype && ctx->page.charset) htmlf("Content-Type: %s; charset=%s\n", ctx->page.mimetype, ctx->page.charset); else if (ctx->page.mimetype) 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", ctx->page.filename); htmlf("Last-Modified: %s\n", http_date(ctx->page.modified)); htmlf("Expires: %s\n", http_date(ctx->page.expires)); if (ctx->page.etag) |