aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2018-07-26 00:53:53 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2018-07-26 00:53:53 +0200
commit29ff2868c9cc7f85442de619525b23ec07d50104 (patch)
tree0ac5fdaf28b7f025f30c3a6f6a8307277d0f8b56
parent00b8de1ca989a0f66517b2a4ccfcc30766f0d669 (diff)
downloadblogc-29ff2868c9cc7f85442de619525b23ec07d50104.tar.gz
blogc-29ff2868c9cc7f85442de619525b23ec07d50104.tar.bz2
blogc-29ff2868c9cc7f85442de619525b23ec07d50104.zip
make: use bm_generate_filename when building ctx
-rw-r--r--src/blogc-make/ctx.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/blogc-make/ctx.c b/src/blogc-make/ctx.c
index 16ab9fa..ee15510 100644
--- a/src/blogc-make/ctx.c
+++ b/src/blogc-make/ctx.c
@@ -20,6 +20,7 @@
#include "atom.h"
#include "settings.h"
#include "exec.h"
+#include "utils.h"
#include "ctx.h"
@@ -238,8 +239,8 @@ bm_ctx_new(bm_ctx_t *base, const char *settings_file, const char *argv0,
rv->posts_fctx = NULL;
if (settings->posts != NULL) {
for (size_t i = 0; settings->posts[i] != NULL; i++) {
- char *f = bc_strdup_printf("%s%s%s/%s%s", content_dir, slash,
- post_prefix, settings->posts[i], source_ext);
+ char *f = bm_generate_filename(content_dir, post_prefix,
+ settings->posts[i], source_ext);
rv->posts_fctx = bc_slist_append(rv->posts_fctx,
bm_filectx_new(rv, f, settings->posts[i], NULL));
free(f);
@@ -249,8 +250,8 @@ bm_ctx_new(bm_ctx_t *base, const char *settings_file, const char *argv0,
rv->pages_fctx = NULL;
if (settings->pages != NULL) {
for (size_t i = 0; settings->pages[i] != NULL; i++) {
- char *f = bc_strdup_printf("%s/%s%s", content_dir,
- settings->pages[i], source_ext);
+ char *f = bm_generate_filename(content_dir, NULL, settings->pages[i],
+ source_ext);
rv->pages_fctx = bc_slist_append(rv->pages_fctx,
bm_filectx_new(rv, f, settings->pages[i], NULL));
free(f);