From 632bd4d1f03cd0d4b6bf397b0768063f6713c12d Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 5 Oct 2007 11:31:17 +0000 Subject: Fix a few errors with the last few commits --- src/env-update.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/env-update.c') diff --git a/src/env-update.c b/src/env-update.c index 2f97719f..1ee13eff 100644 --- a/src/env-update.c +++ b/src/env-update.c @@ -137,8 +137,9 @@ int env_update (int argc, char **argv) if (d->d_name[0] == '.') continue; + path = rc_strcatpaths (ENVDIR, d->d_name, (char *) NULL); j = strlen (d->d_name); - if (stat (d->d_name, &buf) == 0 && S_ISDIR (buf.st_mode) == 0 && + if (stat (path, &buf) == 0 && S_ISDIR (buf.st_mode) == 0 && j > 2 && d->d_name[0] >= '0' && d->d_name[0] <= '9' && @@ -148,9 +149,7 @@ int env_update (int argc, char **argv) (j < 4 || strcmp (d->d_name + j - 4, ".bak") != 0) && (j < 5 || strcmp (d->d_name + j - 5, ".core") != 0)) { - path = rc_strcatpaths (ENVDIR, d->d_name, (char *) NULL); entries = rc_config_load (path); - free (path); STRLIST_FOREACH (entries, entry, j) { char *tmpent = rc_xstrdup (entry); @@ -169,6 +168,7 @@ int env_update (int argc, char **argv) } rc_strlist_free (entries); } + free (path); } closedir (dp); -- cgit v1.2.3