diff --git a/include/ctx.h b/include/ctx.h index af59eb6..b5e39de 100644 --- a/include/ctx.h +++ b/include/ctx.h @@ -68,8 +68,7 @@ void lm_ctx_free(lm_ctx_t *ctx); /* #################### ## main fucntions ## #################### */ -lm_ctx_resolve_list_t *lm_ctx_resolve( - lm_ctx_t *ctx, lm_pkg_t *pkg); // resolves a package and returns a list of packages to install +lm_ctx_resolve_list_t *lm_ctx_resolve(lm_ctx_t *ctx, lm_pkg_t *pkg, lm_ctx_resolve_list_t *list); // resolves a package and returns a list of packages lm_pkg_t *lm_ctx_resolve_next(lm_ctx_resolve_list_t *list); // returns the next package in the list void lm_ctx_resolve_free(lm_ctx_resolve_list_t *list); // frees the resolved list returned by lm_ctx_resolve diff --git a/locale/tr/LC_MESSAGES/libmp.po b/locale/tr/LC_MESSAGES/libmp.po index 5674340..13500e6 100644 --- a/locale/tr/LC_MESSAGES/libmp.po +++ b/locale/tr/LC_MESSAGES/libmp.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-16 19:57+0300\n" +"POT-Creation-Date: 2024-07-16 20:08+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/src/ctx/resolve.c b/src/ctx/resolve.c index 54357dc..5f70d7d 100644 --- a/src/ctx/resolve.c +++ b/src/ctx/resolve.c @@ -45,14 +45,16 @@ end: return true; } -lm_ctx_resolve_list_t *lm_ctx_resolve(lm_ctx_t *ctx, lm_pkg_t *pkg){ +lm_ctx_resolve_list_t *lm_ctx_resolve(lm_ctx_t *ctx, lm_pkg_t *pkg, lm_ctx_resolve_list_t *list){ if(NULL == ctx || NULL == pkg){ lm_error_set(LM_ERR_ArgNULL); return NULL; } - lm_ctx_resolve_list_t *list = malloc(sizeof(lm_ctx_resolve_list_t)); - bzero(list, sizeof(lm_ctx_resolve_list_t)); + if(NULL == list){ + list = malloc(sizeof(lm_ctx_resolve_list_t)); + bzero(list, sizeof(lm_ctx_resolve_list_t)); + } if(!__lm_ctx_resolve(ctx, list, pkg)){ pkglist_free(list->resolving);