diff options
Diffstat (limited to 'cache.c')
-rw-r--r-- | cache.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -43,15 +43,18 @@ int cache_create_dirs() | |||
43 | if (mkdir(path, S_IRWXU) && errno!=EEXIST) | 43 | if (mkdir(path, S_IRWXU) && errno!=EEXIST) |
44 | return 0; | 44 | return 0; |
45 | 45 | ||
46 | if (!cgit_query_repo) | 46 | if (!cgit_repo) |
47 | return 0; | 47 | return 0; |
48 | 48 | ||
49 | path = fmt("%s/%s", cgit_cache_root, cgit_query_repo); | 49 | path = fmt("%s/%s", cgit_cache_root, |
50 | cache_safe_filename(cgit_repo->url)); | ||
51 | |||
50 | if (mkdir(path, S_IRWXU) && errno!=EEXIST) | 52 | if (mkdir(path, S_IRWXU) && errno!=EEXIST) |
51 | return 0; | 53 | return 0; |
52 | 54 | ||
53 | if (cgit_query_page) { | 55 | if (cgit_query_page) { |
54 | path = fmt("%s/%s/%s", cgit_cache_root, cgit_query_repo, | 56 | path = fmt("%s/%s/%s", cgit_cache_root, |
57 | cache_safe_filename(cgit_repo->url), | ||
55 | cgit_query_page); | 58 | cgit_query_page); |
56 | if (mkdir(path, S_IRWXU) && errno!=EEXIST) | 59 | if (mkdir(path, S_IRWXU) && errno!=EEXIST) |
57 | return 0; | 60 | return 0; |