aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
m---------git0
-rw-r--r--html.c9
-rwxr-xr-xtests/t0108-patch.sh2
-rw-r--r--ui-snapshot.c1
5 files changed, 9 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 2a15469..23fdd53 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH)
5CGIT_CONFIG = /etc/cgitrc 5CGIT_CONFIG = /etc/cgitrc
6CACHE_ROOT = /var/cache/cgit 6CACHE_ROOT = /var/cache/cgit
7SHA1_HEADER = <openssl/sha.h> 7SHA1_HEADER = <openssl/sha.h>
8GIT_VER = 1.7.2.2 8GIT_VER = 1.7.3
9GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 9GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2
10INSTALL = install 10INSTALL = install
11 11
diff --git a/git b/git
Subproject 8c67c392e1620fc3b749aa9e0b8da13bd84226f Subproject 87b50542a08ac6caa083ddc376e674424e37940
diff --git a/html.c b/html.c
index 337baeb..eaabf72 100644
--- a/html.c
+++ b/html.c
@@ -268,19 +268,20 @@ int hextoint(char c)
268 268
269char *convert_query_hexchar(char *txt) 269char *convert_query_hexchar(char *txt)
270{ 270{
271 int d1, d2; 271 int d1, d2, n;
272 if (strlen(txt) < 3) { 272 n = strlen(txt);
273 if (n < 3) {
273 *txt = '\0'; 274 *txt = '\0';
274 return txt-1; 275 return txt-1;
275 } 276 }
276 d1 = hextoint(*(txt+1)); 277 d1 = hextoint(*(txt+1));
277 d2 = hextoint(*(txt+2)); 278 d2 = hextoint(*(txt+2));
278 if (d1<0 || d2<0) { 279 if (d1<0 || d2<0) {
279 strcpy(txt, txt+3); 280 memmove(txt, txt+3, n-3);
280 return txt-1; 281 return txt-1;
281 } else { 282 } else {
282 *txt = d1 * 16 + d2; 283 *txt = d1 * 16 + d2;
283 strcpy(txt+1, txt+3); 284 memmove(txt+1, txt+3, n-2);
284 return txt; 285 return txt;
285 } 286 }
286} 287}
diff --git a/tests/t0108-patch.sh b/tests/t0108-patch.sh
index 33351d6..e608104 100755
--- a/tests/t0108-patch.sh
+++ b/tests/t0108-patch.sh
@@ -35,3 +35,5 @@ run_test 'generate patch for initial commit' '
35run_test 'find `cgit` signature' ' 35run_test 'find `cgit` signature' '
36 tail -1 trash/tmp | grep -e "^cgit" 36 tail -1 trash/tmp | grep -e "^cgit"
37' 37'
38
39tests_done
diff --git a/ui-snapshot.c b/ui-snapshot.c
index 1b25dca..6e3412c 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -92,6 +92,7 @@ static int make_snapshot(const struct cgit_snapshot_format *format,
92 } 92 }
93 args.tree = commit->tree; 93 args.tree = commit->tree;
94 args.time = commit->date; 94 args.time = commit->date;
95 args.compression_level = Z_DEFAULT_COMPRESSION;
95 ctx.page.mimetype = xstrdup(format->mimetype); 96 ctx.page.mimetype = xstrdup(format->mimetype);
96 ctx.page.filename = xstrdup(filename); 97 ctx.page.filename = xstrdup(filename);
97 cgit_print_http_headers(&ctx); 98 cgit_print_http_headers(&ctx);