Do not expand the file given with -f so it can contain :s.

pull/2739/head
Nicholas Marriott 2021-05-10 07:51:30 +01:00
parent 434ac8734a
commit 5ea6ccbb7f
1 changed files with 10 additions and 5 deletions

15
tmux.c
View File

@ -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':