-rw-r--r-- | Makefile | 2 | ||||
m--------- | git | 0 | ||||
-rw-r--r-- | html.c | 9 | ||||
-rwxr-xr-x | tests/t0108-patch.sh | 2 | ||||
-rw-r--r-- | ui-snapshot.c | 1 |
5 files changed, 9 insertions, 5 deletions
@@ -1,20 +1,20 @@ CGIT_VERSION = v0.8.3.3 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 SHA1_HEADER = <openssl/sha.h> -GIT_VER = 1.7.2.2 +GIT_VER = 1.7.3 GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 INSTALL = install # Define NO_STRCASESTR if you don't have strcasestr. # # Define NO_OPENSSL to disable linking with OpenSSL and use bundled SHA1 # implementation (slower). # # Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin). # #-include config.mak diff --git a/git b/git -Subproject 8c67c392e1620fc3b749aa9e0b8da13bd84226f +Subproject 87b50542a08ac6caa083ddc376e674424e37940 @@ -259,37 +259,38 @@ int hextoint(char c) if (c >= 'a' && c <= 'f') return 10 + c - 'a'; else if (c >= 'A' && c <= 'F') return 10 + c - 'A'; else if (c >= '0' && c <= '9') return c - '0'; else return -1; } char *convert_query_hexchar(char *txt) { - int d1, d2; - if (strlen(txt) < 3) { + int d1, d2, n; + n = strlen(txt); + if (n < 3) { *txt = '\0'; return txt-1; } d1 = hextoint(*(txt+1)); d2 = hextoint(*(txt+2)); if (d1<0 || d2<0) { - strcpy(txt, txt+3); + memmove(txt, txt+3, n-3); return txt-1; } else { *txt = d1 * 16 + d2; - strcpy(txt+1, txt+3); + memmove(txt+1, txt+3, n-2); return txt; } } int http_parse_querystring(const char *txt_, void (*fn)(const char *name, const char *value)) { char *t, *txt, *value = NULL, c; if (!txt_) return 0; t = txt = strdup(txt_); 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 @@ -26,12 +26,14 @@ run_test 'find `cgit` signature' ' run_test 'find initial commit' ' root=$(git --git-dir=$PWD/trash/repos/foo/.git rev-list HEAD | tail -1) ' run_test 'generate patch for initial commit' ' cgit_query "url=foo/patch&id=$root" >trash/tmp ' run_test 'find `cgit` signature' ' tail -1 trash/tmp | grep -e "^cgit" ' + +tests_done diff --git a/ui-snapshot.c b/ui-snapshot.c index 1b25dca..6e3412c 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -83,24 +83,25 @@ static int make_snapshot(const struct cgit_snapshot_format *format, return 1; } memset(&args, 0, sizeof(args)); if (prefix) { args.base = fmt("%s/", prefix); args.baselen = strlen(prefix) + 1; } else { args.base = ""; args.baselen = 0; } args.tree = commit->tree; args.time = commit->date; + args.compression_level = Z_DEFAULT_COMPRESSION; ctx.page.mimetype = xstrdup(format->mimetype); ctx.page.filename = xstrdup(filename); cgit_print_http_headers(&ctx); format->write_func(&args); return 0; } /* Try to guess the requested revision from the requested snapshot name. * First the format extension is stripped, e.g. "cgit-0.7.2.tar.gz" become * "cgit-0.7.2". If this is a valid commit object name we've got a winner. * Otherwise, if the snapshot name has a prefix matching the result from * repo_basename(), we strip the basename and any following '-' and '_' |