diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-11-03 08:35:52 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-11-03 08:35:52 +0000 |
commit | ba9962b568dd111455963c88b0458cf8847c9690 (patch) | |
tree | a13a66498befbd75237a3a7a3869ccd2c52b8452 /cmd-source-file.c | |
parent | 733abfcfc5b05cb3e1f2cf08f00a9325c6f6fa04 (diff) | |
parent | ff53eed402abb146096673963da39b5036a5c861 (diff) | |
download | rtmux-ba9962b568dd111455963c88b0458cf8847c9690.tar.gz rtmux-ba9962b568dd111455963c88b0458cf8847c9690.tar.bz2 rtmux-ba9962b568dd111455963c88b0458cf8847c9690.zip |
Merge branch 'master' into 3.2-rc
Diffstat (limited to 'cmd-source-file.c')
-rw-r--r-- | cmd-source-file.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cmd-source-file.c b/cmd-source-file.c index f5a0ca4b..1da59193 100644 --- a/cmd-source-file.c +++ b/cmd-source-file.c @@ -35,8 +35,8 @@ const struct cmd_entry cmd_source_file_entry = { .name = "source-file", .alias = "source", - .args = { "nqv", 1, -1 }, - .usage = "[-nqv] path ...", + .args = { "Fnqv", 1, -1 }, + .usage = "[-Fnqv] path ...", .flags = 0, .exec = cmd_source_file_exec @@ -126,7 +126,7 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item) struct cmd_source_file_data *cdata; struct client *c = cmdq_get_client(item); enum cmd_retval retval = CMD_RETURN_NORMAL; - char *pattern, *cwd; + char *pattern, *cwd, *expand = NULL; const char *path, *error; glob_t g; int i, result; @@ -145,7 +145,12 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item) utf8_stravis(&cwd, server_client_get_cwd(c, NULL), VIS_GLOB); for (i = 0; i < args->argc; i++) { - path = args->argv[i]; + if (args_has(args, 'F')) { + free(expand); + expand = format_single_from_target(item, args->argv[i]); + path = expand; + } else + path = args->argv[i]; if (strcmp(path, "-") == 0) { cmd_source_file_add(cdata, "-"); continue; @@ -172,6 +177,7 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item) free(pattern); continue; } + free(expand); free(pattern); for (j = 0; j < g.gl_pathc; j++) |