aboutsummaryrefslogtreecommitdiff
path: root/src/env-update.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-07-19 21:44:55 +0000
committerRoy Marples <roy@marples.name>2007-07-19 21:44:55 +0000
commit76f2391ecea775b6d84299620bd1ac18d22b2564 (patch)
tree09f33db8a20cc2d7d1d538b14456d84350852274 /src/env-update.c
parent26d11b33cf4dc9d15688c734632ea850c6d2e3d3 (diff)
Skip some files in env-update like portage env-update for more robustness
Diffstat (limited to 'src/env-update.c')
-rw-r--r--src/env-update.c11
1 files changed, 10 insertions, 1 deletions
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);