package

simple and robust package manager
Log | Files | Refs | README

commit 6473a11e4fb8b5b09ac31048a4336b90ddfad3d2
parent 429f435c2b3bc1542ac41d3c16a1b381afccf25f
Author: Josuah Demangeon <mail@josuah.net>
Date:   Mon, 21 Jan 2019 00:33:28 +0100

fix endless loop on circular dependencies

Diffstat:
Mpackage.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package.c b/package.c @@ -208,7 +208,7 @@ package_dep_scan(package *p, char const *s, size_t n) } static int -package_hasdep(package const *p, genalloc *packages) +package_dep_has(package const *p, genalloc *packages) { for (size_t i = 0; i < genalloc_len(packages, package); ++i) { @@ -327,9 +327,9 @@ package_dep(package const *p, genalloc *packages, char const *def) if (!stralloc_cat0(&sa)) goto error; if (sa.x[package_dep_scan(&p, sa.x, sa.n)] != '\0') goto error; if (!package_version(&p, def)) goto error; - if (package_hasdep(&p, packages)) continue; - if (!package_dep(&p, packages, def)) goto error; + if (package_dep_has(&p, packages)) continue; if (!genalloc_append(packages, p)) goto error; + if (!package_dep(&p, packages, def)) goto error; } if (r != 0) goto error; }