libmpm

morphux C package management library
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/libmpm

commit 0d66842716d4eaf8eafc5731177d42c38b944e8e
parent 76f3498819aa79ae1b481e7f874537a2a9e6f581
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Tue, 18 Jul 2017 12:21:53 +0200

Fix(Packer): Better error on failed parsing

Diffstat:
Minc/error.h | 2+-
Msrc/packer.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/inc/error.h b/inc/error.h @@ -96,6 +96,6 @@ void mpm_set_str_error(const char *str, ...); * \brief Get an error string, previously set */ char *mpm_get_str_error(void); -# define GET_ERR_STR() mpm_get_str_error() +# define GET_ERR_STR() (strlen(mpm_get_str_error()) == 0 ? mpm_strerror(get_mpm_error()) : mpm_get_str_error()) #endif diff --git a/src/packer.c b/src/packer.c @@ -587,7 +587,7 @@ bool packer_read_dir(packer_t *ctx) { if (ctx->json == NULL) { SET_ERR(ERR_BAD_JSON); - SET_ERR_STR_FMT("Error at parsing JSON in: %s", PACKER_DEF_CONF_FN); + SET_ERR_STR_FMT("Error at parsing JSON in: %s/%s", ctx->str, PACKER_DEF_CONF_FN); goto error; }