aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/env-update.c11
-rw-r--r--src/librc-misc.c1
2 files changed, 11 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);
diff --git a/src/librc-misc.c b/src/librc-misc.c
index fd1282ad..b52c2507 100644
--- a/src/librc-misc.c
+++ b/src/librc-misc.c
@@ -331,6 +331,7 @@ char **rc_get_config (char **list, const char *file)
/* Get entry */
token = strsep (&p, "=");
+
if (! token)
continue;