From 79ebd89d19c2bece426e16cfddf79d642854aeb5 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 4 Jun 2008 19:00:46 +0000 Subject: Only add a backreference if it doesn't already exist. --- src/librc/librc-depend.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/librc') diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c index a4ac6535..26fc5c41 100644 --- a/src/librc/librc-depend.c +++ b/src/librc/librc-depend.c @@ -891,7 +891,11 @@ rc_deptree_update(void) dt->services = rc_stringlist_new(); STAILQ_INSERT_TAIL(&di->depends, dt, entries); } - rc_stringlist_add(dt->services, depinfo->service); + TAILQ_FOREACH(s2, dt->services, entries) + if (strcmp(s2->value, depinfo->service) == 0) + break; + if (!s2) + rc_stringlist_add(dt->services, depinfo->service); } } -- cgit v1.2.3