diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-06-10 07:52:30 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-06-10 07:52:30 +0000 |
commit | a435d1624e2febb4e7e85e15718a5eb5ae1e6c69 (patch) | |
tree | 3eaafd4272b64ae333eb89287aa7a4f2055910d5 /usr.bin/tmux/tmux.c | |
parent | bbe47cd106cac7e65b919000e0e4e8a2b364e0ee (diff) |
Do not expand the file given with -f so it can contain :s.
Diffstat (limited to 'usr.bin/tmux/tmux.c')
-rw-r--r-- | usr.bin/tmux/tmux.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c index 82cb97f0c1d..01a992ac715 100644 --- a/usr.bin/tmux/tmux.c +++ b/usr.bin/tmux/tmux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.c,v 1.206 2021/02/22 11:42:50 nicm Exp $ */ +/* $OpenBSD: tmux.c,v 1.207 2021/06/10 07:52:29 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -338,7 +338,7 @@ main(int argc, char **argv) char *path = NULL, *label = NULL; char *cause, **var; const char *s, *cwd; - int opt, keys, feat = 0; + int opt, keys, feat = 0, fflag = 0; uint64_t flags = 0; const struct options_table_entry *oe; u_int i; @@ -383,10 +383,15 @@ main(int argc, char **argv) flags |= CLIENT_CONTROL; break; case 'f': - for (i = 0; i < cfg_nfiles; i++) - free(cfg_files[i]); - free(cfg_files); - expand_paths(optarg, &cfg_files, &cfg_nfiles, 0); + if (!fflag) { + fflag = 1; + for (i = 0; i < cfg_nfiles; i++) + free(cfg_files[i]); + cfg_nfiles = 0; + } + cfg_files = xreallocarray(cfg_files, cfg_nfiles + 1, + sizeof *cfg_files); + cfg_files[cfg_nfiles++] = xstrdup(optarg); cfg_quiet = 0; break; case 'V': |