aboutsummaryrefslogtreecommitdiffstats
path: root/cmdutils.c
diff options
context:
space:
mode:
authorTimo Lindfors <lindi@kurp.hut.fi>2006-11-27 12:37:43 +0000
committerGuillaume Poirier <gpoirier@mplayerhq.hu>2006-11-27 12:37:43 +0000
commit84bf226b6566287d6c50da425685bb8027645a92 (patch)
tree5068ec116ed4e4c52ba18d806458034b5fbaba62 /cmdutils.c
parentc61b9d4473c4023415ddc35b4562bfc8dc1e6b0c (diff)
downloadffmpeg-84bf226b6566287d6c50da425685bb8027645a92.tar.gz
Add support for files that begin with a dash.
Patch by Timo Lindfors % lindi A kurp P hut P fi % Original thread: Date: Mon, 27 Nov 2006 02:00:14 +0200 Subject: [Ffmpeg-devel] ffplay confused about filenames that begin with a dash Originally committed as revision 7174 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmdutils.c b/cmdutils.c
index cc139c0405..7922051966 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -59,7 +59,7 @@ static const OptionDef* find_option(const OptionDef *po, const char *name){
void parse_options(int argc, char **argv, const OptionDef *options)
{
const char *opt, *arg;
- int optindex;
+ int optindex, handleoptions;
const OptionDef *po;
/* parse options */
@@ -67,7 +67,11 @@ void parse_options(int argc, char **argv, const OptionDef *options)
while (optindex < argc) {
opt = argv[optindex++];
- if (opt[0] == '-' && opt[1] != '\0') {
+ if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
+ if (opt[1] == '-' && opt[2] == '\0') {
+ handleoptions = 0;
+ continue;
+ }
po= find_option(options, opt + 1);
if (!po->name)
po= find_option(options, "default");