aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-make/ctx.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2017-01-03 03:15:07 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2017-01-03 03:15:07 +0100
commita4bddf83cbbac86c3734b8c399e65c7341385a85 (patch)
tree4682d345d352c9e285925c8a073fcc72ad22fc02 /src/blogc-make/ctx.c
parentaa8871ffe2e335b6f4a5107c15e978ba99a9fae5 (diff)
downloadblogc-a4bddf83cbbac86c3734b8c399e65c7341385a85.tar.gz
blogc-a4bddf83cbbac86c3734b8c399e65c7341385a85.tar.bz2
blogc-a4bddf83cbbac86c3734b8c399e65c7341385a85.zip
blogc-make: fixed clean rule
Diffstat (limited to 'src/blogc-make/ctx.c')
-rw-r--r--src/blogc-make/ctx.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/blogc-make/ctx.c b/src/blogc-make/ctx.c
index 7b8dfca..454f99a 100644
--- a/src/blogc-make/ctx.c
+++ b/src/blogc-make/ctx.c
@@ -98,12 +98,18 @@ bm_ctx_new(const char *settings_file, bc_error_t **err)
char *real_filename = realpath(settings_file, NULL);
rv->settings_fctx = bm_filectx_new(rv, real_filename);
- rv->root_dir = bc_strdup(dirname(real_filename));
+ rv->root_dir = realpath(dirname(real_filename), NULL);
free(real_filename);
const char *output_dir = bc_trie_lookup(settings->settings, "output_dir");
- rv->output_dir = output_dir[0] == '/' ? bc_strdup(output_dir) :
- bc_strdup_printf("%s/%s", rv->root_dir, output_dir);
+ if (output_dir[0] == '/') {
+ rv->output_dir = realpath(output_dir, NULL);
+ }
+ else {
+ char *tmp = bc_strdup_printf("%s/%s", rv->root_dir, output_dir);
+ rv->output_dir = realpath(tmp, NULL);
+ free(tmp);
+ }
const char *template_dir = bc_trie_lookup(settings->settings,
"template_dir");