diff options
author | Marco Peereboom <marco@conformal.com> | 2011-01-14 21:23:52 +0000 |
---|---|---|
committer | Marco Peereboom <marco@conformal.com> | 2011-01-14 21:23:52 +0000 |
commit | 80e55b2cfce5c3cbfbe2e6c5f95d46d19256747a (patch) | |
tree | e805423ec13298c02b799049234dd84f2a59f4b2 | |
parent | 46388ff9bd5e55622d5107be51118be9d953e4ae (diff) | |
download | xombrero-80e55b2cfce5c3cbfbe2e6c5f95d46d19256747a.tar.gz |
be more paranoid with session names
-rw-r--r-- | xxxterm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xxxterm.c b/xxxterm.c index 72caaf0..f139628 100644 --- a/xxxterm.c +++ b/xxxterm.c @@ -1523,7 +1523,6 @@ open_tabs(struct tab *t, struct karg *a) goto done; snprintf(file, sizeof file, "%s/%s", sessions_dir, a->s); - if ((f = fopen(file, "r")) == NULL) goto done; @@ -3840,6 +3839,8 @@ session_save(struct tab *t, char *filename, char **ret) goto done; *ret = f; + if (f[0] == '.' || f[0] == '/') + goto done; a.s = f; if (save_tabs(t, &a)) @@ -3865,6 +3866,8 @@ session_open(struct tab *t, char *filename, char **ret) goto done; *ret = f; + if (f[0] == '.' || f[0] == '/') + goto done; a.s = f; a.i = XT_SES_CLOSETABS; @@ -3892,6 +3895,8 @@ session_delete(struct tab *t, char *filename, char **ret) goto done; *ret = f; + if (f[0] == '.' || f[0] == '/') + goto done; snprintf(file, sizeof file, "%s/%s", sessions_dir, f); if (unlink(file)) |