summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2008-03-25 01:00:09 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-03-25 01:00:09 (UTC)
commitdc3282f0baa14949439593729a45fbe143e3622c (patch) (unidiff)
tree2eb7eabeb11c4a1c1e132d396ac5c621caf48414
parentc60781d677ee3b2e53b1f3078fef763622e5effe (diff)
downloadcgit-dc3282f0baa14949439593729a45fbe143e3622c.zip
cgit-dc3282f0baa14949439593729a45fbe143e3622c.tar.gz
cgit-dc3282f0baa14949439593729a45fbe143e3622c.tar.bz2
Remove global and obsolete cgit_cmd
This variable was obsoleted by cmd.c. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--cgit.c2
-rw-r--r--cgit.h1
2 files changed, 1 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index 3943a0f..f749b6b 100644
--- a/cgit.c
+++ b/cgit.c
@@ -172,25 +172,25 @@ static int cgit_prepare_cache(struct cacheitem *item)
172 cgit_print_pageheader(&ctx); 172 cgit_print_pageheader(&ctx);
173 cgit_print_error(fmt("Unknown repo: %s", ctx.qry.repo)); 173 cgit_print_error(fmt("Unknown repo: %s", ctx.qry.repo));
174 cgit_print_docend(); 174 cgit_print_docend();
175 return 0; 175 return 0;
176 } 176 }
177 177
178 if (!ctx.repo) { 178 if (!ctx.repo) {
179 item->name = xstrdup(fmt("%s/index.html", ctx.cfg.cache_root)); 179 item->name = xstrdup(fmt("%s/index.html", ctx.cfg.cache_root));
180 item->ttl = ctx.cfg.cache_root_ttl; 180 item->ttl = ctx.cfg.cache_root_ttl;
181 return 1; 181 return 1;
182 } 182 }
183 183
184 if (!cgit_cmd) { 184 if (!ctx.qry.page) {
185 item->name = xstrdup(fmt("%s/%s/index.%s.html", ctx.cfg.cache_root, 185 item->name = xstrdup(fmt("%s/%s/index.%s.html", ctx.cfg.cache_root,
186 cache_safe_filename(ctx.repo->url), 186 cache_safe_filename(ctx.repo->url),
187 cache_safe_filename(ctx.qry.raw))); 187 cache_safe_filename(ctx.qry.raw)));
188 item->ttl = ctx.cfg.cache_repo_ttl; 188 item->ttl = ctx.cfg.cache_repo_ttl;
189 } else { 189 } else {
190 item->name = xstrdup(fmt("%s/%s/%s/%s.html", ctx.cfg.cache_root, 190 item->name = xstrdup(fmt("%s/%s/%s/%s.html", ctx.cfg.cache_root,
191 cache_safe_filename(ctx.repo->url), 191 cache_safe_filename(ctx.repo->url),
192 ctx.qry.page, 192 ctx.qry.page,
193 cache_safe_filename(ctx.qry.raw))); 193 cache_safe_filename(ctx.qry.raw)));
194 if (ctx.qry.has_symref) 194 if (ctx.qry.has_symref)
195 item->ttl = ctx.cfg.cache_dynamic_ttl; 195 item->ttl = ctx.cfg.cache_dynamic_ttl;
196 else if (ctx.qry.has_sha1) 196 else if (ctx.qry.has_sha1)
diff --git a/cgit.h b/cgit.h
index b58676b..e82e9aa 100644
--- a/cgit.h
+++ b/cgit.h
@@ -180,25 +180,24 @@ struct cgit_context {
180struct cgit_snapshot_format { 180struct cgit_snapshot_format {
181 const char *suffix; 181 const char *suffix;
182 const char *mimetype; 182 const char *mimetype;
183 write_archive_fn_t write_func; 183 write_archive_fn_t write_func;
184 int bit; 184 int bit;
185}; 185};
186 186
187extern const char *cgit_version; 187extern const char *cgit_version;
188 188
189extern struct cgit_repolist cgit_repolist; 189extern struct cgit_repolist cgit_repolist;
190extern struct cgit_context ctx; 190extern struct cgit_context ctx;
191extern const struct cgit_snapshot_format cgit_snapshot_formats[]; 191extern const struct cgit_snapshot_format cgit_snapshot_formats[];
192extern int cgit_cmd;
193 192
194extern struct cgit_repo *cgit_add_repo(const char *url); 193extern struct cgit_repo *cgit_add_repo(const char *url);
195extern struct cgit_repo *cgit_get_repoinfo(const char *url); 194extern struct cgit_repo *cgit_get_repoinfo(const char *url);
196extern void cgit_repo_config_cb(const char *name, const char *value); 195extern void cgit_repo_config_cb(const char *name, const char *value);
197 196
198extern int chk_zero(int result, char *msg); 197extern int chk_zero(int result, char *msg);
199extern int chk_positive(int result, char *msg); 198extern int chk_positive(int result, char *msg);
200extern int chk_non_negative(int result, char *msg); 199extern int chk_non_negative(int result, char *msg);
201 200
202extern int hextoint(char c); 201extern int hextoint(char c);
203extern char *trim_end(const char *str, char c); 202extern char *trim_end(const char *str, char c);
204extern char *strlpart(char *txt, int maxlen); 203extern char *strlpart(char *txt, int maxlen);