Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Correctly display a summary of the loaded plugins
Marin Atanasov Nikolov committed 13 years ago
commit 231d9e8e9639749a58db48fda543c3d04f413d56
parent bd570b6
1 file changed +4 -1
modified libpkg/plugins.c
@@ -62,6 +62,7 @@ struct pkg_plugins {

STAILQ_HEAD(plugins_head, pkg_plugins);
static struct plugins_head ph = STAILQ_HEAD_INITIALIZER(ph);
+
static unsigned int have_plugins_loaded = 0;

static int pkg_plugins_discover(void);
static int pkg_plugins_parse_conf(const char *file);
@@ -251,6 +252,8 @@ pkg_plugins_load(struct pkg_plugins *p)
		dlclose(p->lh);
	}

+
	have_plugins_loaded++;
+

	return (rc);
}

@@ -351,7 +354,7 @@ pkg_plugins_display_loaded(void)
{
	struct pkg_plugins *p = NULL;

-
	if (!STAILQ_EMPTY(&ph))
+
	if (STAILQ_EMPTY(&ph) || have_plugins_loaded == 0)
		return (EPKG_OK);

	printf("Plugins loaded: ");