]> gitweb.ps.run Git - ps-cgit/commitdiff
Merge branch 'ml/bugfix'
authorLars Hjemli <hjemli@gmail.com>
Sun, 19 Sep 2010 17:00:05 +0000 (19:00 +0200)
committerLars Hjemli <hjemli@gmail.com>
Sun, 19 Sep 2010 17:00:05 +0000 (19:00 +0200)
1  2 
Makefile
cgit.c
cgit.h

diff --combined Makefile
index 23fdd53d2b382fb2c71f0077d9e39e8f03704789,6c9d1184e2d5a3830fc113ae69e2da77645c0f6d..6a47ed256d7ff4f5bef91e5e983f160bc6a1d11e
+++ 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 = <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 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 e1d2216ffb3ae32b3a343cb677647fb716c01a40,3b3f8d98a8a180d5d6ac9c87ed53e4b8f3263e25..96900bb5afbc04f02c0e643b22175c78e3886197
--- 1/cgit.c
--- 2/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"))
                                      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 f8076c58061cdde0a1656006525e6e5c58f96b56,8f8428196ac2fe05e8141e0c893cc29ad362c18d..8f5dd2a7f2046eaca5b7eda311efa093f6f0f664
--- 1/cgit.h
--- 2/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;
        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);