diff options
Diffstat (limited to 'src/blogc-make/ctx.c')
-rw-r--r-- | src/blogc-make/ctx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/blogc-make/ctx.c b/src/blogc-make/ctx.c index 0a3f9a0..0c47c12 100644 --- a/src/blogc-make/ctx.c +++ b/src/blogc-make/ctx.c @@ -234,12 +234,13 @@ bm_ctx_new(bm_ctx_t *base, const char *settings_file, const char *argv0, const char *content_dir = bc_trie_lookup(settings->settings, "content_dir"); const char *post_prefix = bc_trie_lookup(settings->settings, "post_prefix"); const char *source_ext = bc_trie_lookup(settings->settings, "source_ext"); + const char *slash = post_prefix[0] == '\0' ? "" : "/"; 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", content_dir, post_prefix, - settings->posts[i], source_ext); + char *f = bc_strdup_printf("%s%s%s/%s%s", content_dir, slash, + 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); |