diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-03-14 01:20:27 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-03-14 01:20:27 +0100 |
commit | 20316ce96980918d1a1c421670c38a3ff7665576 (patch) | |
tree | dad620b8279702d6a589de2521d2cfa0b4dd26be /src/blogc-make/ctx.c | |
parent | 2c0da26daa81caf40461758bbab5ff494534def4 (diff) | |
download | blogc-20316ce96980918d1a1c421670c38a3ff7665576.tar.gz blogc-20316ce96980918d1a1c421670c38a3ff7665576.tar.bz2 blogc-20316ce96980918d1a1c421670c38a3ff7665576.zip |
Revert "Revert "make: fixed context reloading""
This reverts commit 6dc12e00c852b143429b3db0c01cb9abcf102b8f.
Diffstat (limited to 'src/blogc-make/ctx.c')
-rw-r--r-- | src/blogc-make/ctx.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/blogc-make/ctx.c b/src/blogc-make/ctx.c index 8e152da..0a3f9a0 100644 --- a/src/blogc-make/ctx.c +++ b/src/blogc-make/ctx.c @@ -270,20 +270,20 @@ bm_ctx_new(bm_ctx_t *base, const char *settings_file, const char *argv0, bool -bm_ctx_reload(bm_ctx_t *ctx) +bm_ctx_reload(bm_ctx_t **ctx) { - if (ctx == NULL || ctx->settings_fctx == NULL) + if (*ctx == NULL || (*ctx)->settings_fctx == NULL) return false; - if (bm_filectx_changed(ctx->settings_fctx, NULL, NULL)) { + if (bm_filectx_changed((*ctx)->settings_fctx, NULL, NULL)) { // reload everything! we could just reload settings_fctx, as this // would force rebuilding everything, but we need to know new/deleted // files // needs to dup path, because it may be freed when reloading. - char *tmp = bc_strdup(ctx->settings_fctx->path); + char *tmp = bc_strdup((*ctx)->settings_fctx->path); bc_error_t *err = NULL; - ctx = bm_ctx_new(ctx, tmp, NULL, &err); + *ctx = bm_ctx_new(*ctx, tmp, NULL, &err); free(tmp); if (err != NULL) { bc_error_print(err, "blogc-make"); @@ -293,16 +293,16 @@ bm_ctx_reload(bm_ctx_t *ctx) return true; } - bm_filectx_reload(ctx->main_template_fctx); - bm_filectx_reload(ctx->atom_template_fctx); + bm_filectx_reload((*ctx)->main_template_fctx); + bm_filectx_reload((*ctx)->atom_template_fctx); - for (bc_slist_t *tmp = ctx->posts_fctx; tmp != NULL; tmp = tmp->next) + for (bc_slist_t *tmp = (*ctx)->posts_fctx; tmp != NULL; tmp = tmp->next) bm_filectx_reload((bm_filectx_t*) tmp->data); - for (bc_slist_t *tmp = ctx->pages_fctx; tmp != NULL; tmp = tmp->next) + for (bc_slist_t *tmp = (*ctx)->pages_fctx; tmp != NULL; tmp = tmp->next) bm_filectx_reload((bm_filectx_t*) tmp->data); - for (bc_slist_t *tmp = ctx->copy_fctx; tmp != NULL; tmp = tmp->next) + for (bc_slist_t *tmp = (*ctx)->copy_fctx; tmp != NULL; tmp = tmp->next) bm_filectx_reload((bm_filectx_t*) tmp->data); return true; |