aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-make/rules.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2019-07-24 18:04:28 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2019-07-24 18:04:28 +0200
commit8a4e6248052ff32e02dcec3dd6850d4582836fb5 (patch)
tree6cec5c6839bceac42c3a3006fccae619c842c850 /src/blogc-make/rules.c
parent3b27b61e5409f58531e4aa8ce899b2d9c96fb433 (diff)
downloadblogc-8a4e6248052ff32e02dcec3dd6850d4582836fb5.tar.gz
blogc-8a4e6248052ff32e02dcec3dd6850d4582836fb5.tar.bz2
blogc-8a4e6248052ff32e02dcec3dd6850d4582836fb5.zip
make: fixed filename generation for pagination_tags
Diffstat (limited to 'src/blogc-make/rules.c')
-rw-r--r--src/blogc-make/rules.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/blogc-make/rules.c b/src/blogc-make/rules.c
index 591ad21..06223c0 100644
--- a/src/blogc-make/rules.c
+++ b/src/blogc-make/rules.c
@@ -367,24 +367,19 @@ pagination_tags_outputlist(bm_ctx_t *ctx)
bc_trie_free(local);
if (last_page == NULL)
- break;
+ continue;
long pages = strtol(last_page, NULL, 10);
free(last_page);
- char *prefix = bc_strdup_printf("%s/%s/%s", tag_prefix,
- ctx->settings->tags[k], pagination_prefix);
-
for (size_t i = 0; i < pages; i++) {
char *j = bc_strdup_printf("%d", i + 1);
- char *f = bm_generate_filename(ctx->short_output_dir, prefix,
- j, html_ext);
+ char *f = bm_generate_filename2(ctx->short_output_dir, tag_prefix,
+ ctx->settings->tags[k], pagination_prefix, j, html_ext);
rv = bc_slist_append(rv, bm_filectx_new(ctx, f, NULL, NULL));
free(j);
free(f);
}
-
- free(prefix);
}
bc_trie_free(variables);
@@ -425,16 +420,14 @@ pagination_tags_exec(bm_ctx_t *ctx, bc_slist_t *outputs, bc_trie_t *args)
// tag and page from the file path right now :/
char *tag = NULL;
for (size_t i = 0; ctx->settings->tags[i] != NULL; i++) {
- char *prefix = bc_strdup_printf("%s/%s/%s", tag_prefix,
- ctx->settings->tags[i], pagination_prefix);
bool b = false;
// it is impossible to have more output files per tag than the whole
// amount of output pages
for (size_t k = 1; k <= bc_slist_length(outputs); k++) {
char *j = bc_strdup_printf("%d", k);
- char *f = bm_generate_filename(ctx->short_output_dir, prefix,
- j, html_ext);
+ char *f = bm_generate_filename2(ctx->short_output_dir, tag_prefix,
+ ctx->settings->tags[i], pagination_prefix, j, html_ext);
free(j);
if (0 == strcmp(fctx->short_path, f)) {
tag = ctx->settings->tags[i];
@@ -445,7 +438,6 @@ pagination_tags_exec(bm_ctx_t *ctx, bc_slist_t *outputs, bc_trie_t *args)
}
free(f);
}
- free(prefix);
if (b)
break;
}