aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-09-01 00:51:41 +0000
committerRoy Marples <roy@marples.name>2007-09-01 00:51:41 +0000
commitc04af92cb48c3751d551bc5248bec41d0713603d (patch)
tree64d3e397020ae6de7d8492223966acf71f598528 /src
parenta9ebc7a2afe7db48e4dee6cbb694d6c956413472 (diff)
We may not always add to the array, so re-count it afterwards
Diffstat (limited to 'src')
-rw-r--r--src/env-update.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/env-update.c b/src/env-update.c
index 00feb282..909264d2 100644
--- a/src/env-update.c
+++ b/src/env-update.c
@@ -95,7 +95,6 @@ int env_update (int argc, char **argv)
bool ld = true;
char *ldent;
char **ldents = NULL;
- int nents = 0;
char **config = NULL;
char *entry;
char **mycolons = NULL;
@@ -287,7 +286,6 @@ int env_update (int argc, char **argv)
continue;
ldents = rc_strlist_addu (ldents, file);
- nents++;
}
if (ldconfig) {
@@ -295,7 +293,12 @@ int env_update (int argc, char **argv)
if (rc_exists (LDSOCONF)) {
char **lines = rc_get_list (NULL, LDSOCONF);
char *line;
+ int nents = 0;
ld = false;
+
+ STRLIST_FOREACH (ldents, line, i)
+ nents ++;
+
STRLIST_FOREACH (lines, line, i)
if (i > nents || strcmp (line, ldents[i - 1]) != 0)
{