summaryrefslogtreecommitdiff
path: root/cmdutils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-17 17:03:07 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-19 14:50:36 +0100
commit938152196871be80d2dfa6cf9728ee0873132604 (patch)
tree4788d28cefef7a8e35052e95d92e7417036efc62 /cmdutils.c
parent61625565e461d1f477889d168f4f87a8d1a99fb6 (diff)
cmdline: fix -- to escape files starting with -
Fixes Ticket2127 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 38c8159e73..9d916e7416 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -656,6 +656,7 @@ int split_commandline(OptionParseContext *octx, int argc, char *argv[],
const OptionGroupDef *groups, int nb_groups)
{
int optindex = 1;
+ int dashdash = -2;
/* perform system-dependent conversions for arguments list */
prepare_app_arguments(&argc, &argv);
@@ -670,8 +671,12 @@ int split_commandline(OptionParseContext *octx, int argc, char *argv[],
av_log(NULL, AV_LOG_DEBUG, "Reading option '%s' ...", opt);
+ if (opt[0] == '-' && opt[1] == '-' && !opt[2]) {
+ dashdash = optindex;
+ continue;
+ }
/* unnamed group separators, e.g. output filename */
- if (opt[0] != '-' || !opt[1]) {
+ if (opt[0] != '-' || !opt[1] || dashdash+1 == optindex) {
finish_group(octx, 0, opt);
av_log(NULL, AV_LOG_DEBUG, " matched as %s.\n", groups[0].name);
continue;