about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--cgit.c9
-rw-r--r--cmd.c48
-rw-r--r--cmd.h1
3 files changed, 24 insertions, 34 deletions
diff --git a/cgit.c b/cgit.c index 3a97563..7271412 100644 --- a/cgit.c +++ b/cgit.c
@@ -736,16 +736,7 @@ static void process_request(void)
736 if (cmd->pre) 736 if (cmd->pre)
737 cmd->pre(); 737 cmd->pre();
738 738
739 if (cmd->want_layout) {
740 cgit_print_http_headers();
741 cgit_print_docstart();
742 cgit_print_pageheader();
743 }
744
745 cmd->fn(); 739 cmd->fn();
746
747 if (cmd->want_layout)
748 cgit_print_docend();
749} 740}
750 741
751static int cmp_repos(const void *a, const void *b) 742static int cmp_repos(const void *a, const void *b)
diff --git a/cmd.c b/cmd.c index 3c90d0b..05494fe 100644 --- a/cmd.c +++ b/cmd.c
@@ -145,34 +145,34 @@ static void tree_fn(void)
145 cgit_print_tree(ctx.qry.sha1, ctx.qry.path); 145 cgit_print_tree(ctx.qry.sha1, ctx.qry.path);
146} 146}
147 147
148#define def_cmp(name, want_repo, want_layout, want_vpath, is_clone) \ 148#define def_cmp(name, want_repo, want_vpath, is_clone) \
149 {#name, name##_fn, name##_pre, want_repo, want_layout, want_vpath, is_clone} 149 {#name, name##_fn, name##_pre, want_repo, want_vpath, is_clone}
150#define def_cmd(name, want_repo, want_layout, want_vpath, is_clone) \ 150#define def_cmd(name, want_repo, want_vpath, is_clone) \
151 {#name, name##_fn, NULL, want_repo, want_layout, want_vpath, is_clone} 151 {#name, name##_fn, NULL, want_repo, want_vpath, is_clone}
152 152
153struct cgit_cmd *cgit_get_cmd(void) 153struct cgit_cmd *cgit_get_cmd(void)
154{ 154{
155 static struct cgit_cmd cmds[] = { 155 static struct cgit_cmd cmds[] = {
156 def_cmd(HEAD, 1, 0, 0, 1), 156 def_cmd(HEAD, 1, 0, 1),
157 def_cmd(atom, 1, 0, 0, 0), 157 def_cmd(atom, 1, 0, 0),
158 def_cmp(about, 0, 0, 0, 0), 158 def_cmp(about, 0, 0, 0),
159 def_cmd(blob, 1, 0, 0, 0), 159 def_cmd(blob, 1, 0, 0),
160 def_cmd(commit, 1, 0, 1, 0), 160 def_cmd(commit, 1, 1, 0),
161 def_cmd(diff, 1, 0, 1, 0), 161 def_cmd(diff, 1, 1, 0),
162 def_cmd(info, 1, 0, 0, 1), 162 def_cmd(info, 1, 0, 1),
163 def_cmd(log, 1, 0, 1, 0), 163 def_cmd(log, 1, 1, 0),
164 def_cmd(ls_cache, 0, 0, 0, 0), 164 def_cmd(ls_cache, 0, 0, 0),
165 def_cmd(objects, 1, 0, 0, 1), 165 def_cmd(objects, 1, 0, 1),
166 def_cmd(patch, 1, 0, 1, 0), 166 def_cmd(patch, 1, 1, 0),
167 def_cmd(plain, 1, 0, 0, 0), 167 def_cmd(plain, 1, 0, 0),
168 def_cmd(rawdiff, 1, 0, 1, 0), 168 def_cmd(rawdiff, 1, 1, 0),
169 def_cmd(refs, 1, 0, 0, 0), 169 def_cmd(refs, 1, 0, 0),
170 def_cmd(repolist, 0, 0, 0, 0), 170 def_cmd(repolist, 0, 0, 0),
171 def_cmd(snapshot, 1, 0, 0, 0), 171 def_cmd(snapshot, 1, 0, 0),
172 def_cmd(stats, 1, 0, 1, 0), 172 def_cmd(stats, 1, 1, 0),
173 def_cmd(summary, 1, 0, 0, 0), 173 def_cmd(summary, 1, 0, 0),
174 def_cmd(tag, 1, 0, 0, 0), 174 def_cmd(tag, 1, 0, 0),
175 def_cmd(tree, 1, 0, 1, 0), 175 def_cmd(tree, 1, 1, 0),
176 }; 176 };
177 int i; 177 int i;
178 178
diff --git a/cmd.h b/cmd.h index 2507ca5..1a98089 100644 --- a/cmd.h +++ b/cmd.h
@@ -9,7 +9,6 @@ struct cgit_cmd {
9 cgit_cmd_fn fn; 9 cgit_cmd_fn fn;
10 cgit_cmd_pre_fn pre; 10 cgit_cmd_pre_fn pre;
11 unsigned int want_repo:1, 11 unsigned int want_repo:1,
12 want_layout:1,
13 want_vpath:1, 12 want_vpath:1,
14 is_clone:1; 13 is_clone:1;
15}; 14};