From: Lars Hjemli Date: Sun, 19 Sep 2010 17:00:05 +0000 (+0200) Subject: Merge branch 'ml/bugfix' X-Git-Url: https://gitweb.ps.run/ps-cgit/commitdiff_plain/a9d6e6e695da6c6ed7f4bb32630ab2f3d9314806?hp=-c Merge branch 'ml/bugfix' --- a9d6e6e695da6c6ed7f4bb32630ab2f3d9314806 diff --combined Makefile index 23fdd53,6c9d118..6a47ed2 --- a/Makefile +++ b/Makefile @@@ -5,7 -5,7 +5,7 @@@ CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH CGIT_CONFIG = /etc/cgitrc CACHE_ROOT = /var/cache/cgit SHA1_HEADER = -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 @@@ -16,6 -16,11 +16,11 @@@ # # Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin). # + # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) + # do not support the 'size specifiers' introduced by C99, namely ll, hh, + # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). + # some C compilers supported these specifiers prior to C99 as an extension. + # #-include config.mak @@@ -127,6 -132,9 +132,9 @@@ endi ifdef NO_STRCASESTR CFLAGS += -DNO_STRCASESTR endif + ifdef NO_C99_FORMAT + CFLAGS += -DNO_C99_FORMAT + endif ifdef NO_OPENSSL CFLAGS += -DNO_OPENSSL GIT_OPTIONS += NO_OPENSSL=1 diff --combined cgit.c index e1d2216,3b3f8d9..96900bb --- a/cgit.c +++ b/cgit.c @@@ -72,7 -72,11 +72,7 @@@ void repo_config(struct cgit_repo *repo else if (!strcmp(name, "section")) repo->section = xstrdup(value); else if (!strcmp(name, "readme") && value != NULL) { - char *colon; - if (*value == '/' || ((colon = strchr(value, ':')) != NULL && colon != value && *(colon + 1) != '\0')) - repo->readme = xstrdup(value); - else - repo->readme = xstrdup(fmt("%s/%s", repo->path, value)); + repo->readme = xstrdup(value); } else if (ctx.cfg.enable_filter_overrides) { if (!strcmp(name, "about-filter")) repo->about_filter = new_filter(value, 0); @@@ -93,8 -97,6 +93,8 @@@ void config_cb(const char *name, const ctx.repo->path = trim_end(value, '/'); else if (ctx.repo && !prefixcmp(name, "repo.")) repo_config(ctx.repo, name + 5, value); + else if (!strcmp(name, "readme")) + ctx.cfg.readme = xstrdup(value); else if (!strcmp(name, "root-title")) ctx.cfg.root_title = xstrdup(value); else if (!strcmp(name, "root-desc")) @@@ -193,8 -195,6 +193,8 @@@ ctx.cfg.project_list, repo_config); else scan_tree(expand_macros(value), repo_config); + else if (!strcmp(name, "section-from-path")) + ctx.cfg.section_from_path = atoi(value); else if (!strcmp(name, "source-filter")) ctx.cfg.source_filter = new_filter(value, 1); else if (!strcmp(name, "summary-log")) @@@ -610,7 -610,7 +610,7 @@@ static void process_cached_repolist(con hash = hash_str(path); if (ctx.cfg.project_list) hash += hash_str(ctx.cfg.project_list); - cached_rc = xstrdup(fmt("%s/rc-%8x", ctx.cfg.cache_root, hash)); + cached_rc = xstrdup(fmt("%s/rc-%8lx", ctx.cfg.cache_root, hash)); if (stat(cached_rc, &st)) { /* Nothing is cached, we need to scan without forking. And diff --combined cgit.h index f8076c5,8f84281..8f5dd2a --- a/cgit.h +++ b/cgit.h @@@ -168,7 -168,6 +168,7 @@@ struct cgit_config char *logo_link; char *module_link; char *project_list; + char *readme; char *robots; char *root_title; char *root_desc; @@@ -206,7 -205,6 +206,7 @@@ int noheader; int renamelimit; int remove_suffix; + int section_from_path; int snapshots; int summary_branches; int summary_log; @@@ -295,6 -293,7 +295,7 @@@ extern void cgit_diff_tree(const unsign extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); + __attribute__((format (printf,1,2))) extern char *fmt(const char *format,...); extern struct commitinfo *cgit_parse_commit(struct commit *commit);