about summary refs log tree commit diff
path: root/cache.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2008-02-16 13:56:09 +0100
committerLars Hjemli <hjemli@gmail.com>2008-02-16 13:56:09 +0100
commitd1f3bbe9d22029f45a77bb938c176ccc0c827d46 (patch)
tree3f1741c012763cbc5485f31377abdd9241fbac6b /cache.c
parentAdd all config variables into struct cgit_context (diff)
downloadcgit-pink-d1f3bbe9d22029f45a77bb938c176ccc0c827d46.tar.gz
cgit-pink-d1f3bbe9d22029f45a77bb938c176ccc0c827d46.zip
Move cgit_repo into cgit_context
This removes the global variable which is used to keep track of the
currently selected repository, and adds a new variable in the cgit_context
structure.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to '')
-rw-r--r--cache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cache.c b/cache.c
index 2ed0d6f..7860fc7 100644
--- a/cache.c
+++ b/cache.c
@@ -48,18 +48,18 @@ int cache_create_dirs()
 	if (mkdir(path, S_IRWXU) && errno!=EEXIST)
 		return 0;
 
-	if (!cgit_repo)
+	if (!ctx.repo)
 		return 0;
 
 	path = fmt("%s/%s", ctx.cfg.cache_root,
-		   cache_safe_filename(cgit_repo->url));
+		   cache_safe_filename(ctx.repo->url));
 
 	if (mkdir(path, S_IRWXU) && errno!=EEXIST)
 		return 0;
 
 	if (ctx.qry.page) {
 		path = fmt("%s/%s/%s", ctx.cfg.cache_root,
-			   cache_safe_filename(cgit_repo->url),
+			   cache_safe_filename(ctx.repo->url),
 			   ctx.qry.page);
 		if (mkdir(path, S_IRWXU) && errno!=EEXIST)
 			return 0;
19-09-10Use curl error bufferJune McEnroe 2019-09-10Set Accept-Encoding in titleJune McEnroe 2019-09-08Set title User-AgentJune McEnroe 2019-09-07Add -x flag to titleJune McEnroe 2019-09-07Ignore SIGPIPE in relayJune McEnroe 2019-09-07Add A Memory Called EmpireJune McEnroe 2019-09-05Handle lack of Content-TypeJune McEnroe 2019-09-05Use CURLINFO_CONTENT_TYPEJune McEnroe 2019-09-05Decode entities in titlesJune McEnroe 2019-09-05Print title as soon as it's availableJune McEnroe 2019-09-05Use CURL_PREFIX to set flagsJune McEnroe 2019-09-05Add titleJune McEnroe 2019-09-04Add Avorter n'est pas tuerJune McEnroe 2019-08-29Unset executable on shell scriptsJune McEnroe 2019-08-29Add long-missing setopt to bin.7June McEnroe 2019-08-29Add editJune McEnroe