]> gitweb.ps.run Git - ps-cgit/commitdiff
Merge branch 'stable'
authorLars Hjemli <hjemli@gmail.com>
Sat, 5 Mar 2011 13:01:59 +0000 (14:01 +0100)
committerLars Hjemli <hjemli@gmail.com>
Sat, 5 Mar 2011 13:01:59 +0000 (14:01 +0100)
Makefile
cgit.c
html.c
ui-shared.c

index a9887517a14f72235f04a86eb3ae4d8ec67a156d..14b4df41dcf2ae829cab816e2b60769b83cd5262 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-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)
@@ -241,4 +241,4 @@ 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
diff --git a/cgit.c b/cgit.c
index 916feb4f10dd3f128a10381d39f139cfa318b9a9..f4dd6ef93c4b1b73d1583df8cab06627e34ae491 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -752,10 +752,11 @@ int main(int argc, const char **argv)
        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
diff --git a/html.c b/html.c
index a1fe87d759cee3345d544f2e9ebca49b34f36347..a60bc1386f46a94a2128932d3df8de4760d6590a 100644 (file)
--- a/html.c
+++ b/html.c
@@ -277,7 +277,7 @@ char *convert_query_hexchar(char *txt)
        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;
index 7efae7ab04982bf6d5f557cba1d9cdc9b91f9ede..5aa911956aa3cbf344b437e15aad761f5cd11d86 100644 (file)
@@ -574,7 +574,7 @@ void cgit_print_http_headers(struct cgit_context *ctx)
        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);