From 76f2391ecea775b6d84299620bd1ac18d22b2564 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 19 Jul 2007 21:44:55 +0000 Subject: Skip some files in env-update like portage env-update for more robustness --- src/env-update.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/env-update.c') diff --git a/src/env-update.c b/src/env-update.c index de886a33..5527070d 100644 --- a/src/env-update.c +++ b/src/env-update.c @@ -127,7 +127,16 @@ int main (int argc, char **argv) char *path = rc_strcatpaths (ENVDIR, file, (char *) NULL); char **entries = NULL; - if (! rc_is_dir (path)) + j = strlen (file); + if (! rc_is_dir (path) && + j > 2 && + *file >= '0' && + *file <= '9' && + *(file + 1) >= '0' && + *(file + 1) <= '9' && + *(file + j - 1) != '~' && + (j < 4 || strcmp (file + j - 4, ".bak") != 0) && + (j < 5 || strcmp (file + j - 5, ".core") != 0)) entries = rc_get_config (NULL, path); free (path); -- cgit v1.2.3