diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2021-05-10 07:51:30 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2021-06-10 09:23:07 +0100 |
commit | 5ea6ccbb7f75b6a977fca0751ef0b81b18c375d1 (patch) | |
tree | e74bb406c28084838d4b504f9e810ccc6936cc07 | |
parent | 434ac8734af2a15d5661139acc06a9659f4feed9 (diff) | |
download | rtmux-5ea6ccbb7f75b6a977fca0751ef0b81b18c375d1.tar.gz rtmux-5ea6ccbb7f75b6a977fca0751ef0b81b18c375d1.tar.bz2 rtmux-5ea6ccbb7f75b6a977fca0751ef0b81b18c375d1.zip |
Do not expand the file given with -f so it can contain :s.
-rw-r--r-- | tmux.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -328,7 +328,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; @@ -373,10 +373,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': |