mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
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
This commit is contained in:
parent
c61b9d4473
commit
84bf226b65
@ -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)
|
void parse_options(int argc, char **argv, const OptionDef *options)
|
||||||
{
|
{
|
||||||
const char *opt, *arg;
|
const char *opt, *arg;
|
||||||
int optindex;
|
int optindex, handleoptions;
|
||||||
const OptionDef *po;
|
const OptionDef *po;
|
||||||
|
|
||||||
/* parse options */
|
/* parse options */
|
||||||
@ -67,7 +67,11 @@ void parse_options(int argc, char **argv, const OptionDef *options)
|
|||||||
while (optindex < argc) {
|
while (optindex < argc) {
|
||||||
opt = argv[optindex++];
|
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);
|
po= find_option(options, opt + 1);
|
||||||
if (!po->name)
|
if (!po->name)
|
||||||
po= find_option(options, "default");
|
po= find_option(options, "default");
|
||||||
|
Loading…
Reference in New Issue
Block a user