Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
87093f53
Commit
87093f53
authored
Dec 18, 2000
by
Morten Welinder
Committed by
Alexandre Julliard
Dec 18, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(parse_options): Allow GNU-like option arguments like
"--desktop=800x600". (Not perfect -- we don't allow shorthands.)
parent
35d288bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
options.c
misc/options.c
+20
-2
No files found.
misc/options.c
View file @
87093f53
...
...
@@ -248,6 +248,7 @@ static void parse_options( char *argv[] )
for
(
i
=
0
;
argv
[
i
];
i
++
)
{
const
char
*
equalarg
=
NULL
;
char
*
p
=
argv
[
i
];
if
(
*
p
++
!=
'-'
)
continue
;
/* not an option */
if
(
*
p
&&
!
p
[
1
])
/* short name */
...
...
@@ -257,14 +258,31 @@ static void parse_options( char *argv[] )
}
else
/* long name */
{
const
char
*
equal
=
strchr
(
p
,
'='
);
if
(
*
p
==
'-'
)
p
++
;
/* check for the long name */
for
(
opt
=
option_table
;
opt
->
longname
;
opt
++
)
for
(
opt
=
option_table
;
opt
->
longname
;
opt
++
)
{
/* Plain --option */
if
(
!
strcmp
(
p
,
opt
->
longname
))
break
;
/* --option=value */
if
(
opt
->
has_arg
&&
equal
&&
strlen
(
opt
->
longname
)
==
equal
-
p
&&
!
strncmp
(
p
,
opt
->
longname
,
equal
-
p
))
{
equalarg
=
equal
+
1
;
break
;
}
}
}
if
(
!
opt
->
longname
)
continue
;
if
(
opt
->
has_arg
&&
argv
[
i
+
1
])
if
(
equalarg
)
{
opt
->
func
(
equalarg
);
remove_options
(
argv
,
i
,
1
,
opt
->
inherit
);
}
else
if
(
opt
->
has_arg
&&
argv
[
i
+
1
])
{
opt
->
func
(
argv
[
i
+
1
]
);
remove_options
(
argv
,
i
,
2
,
opt
->
inherit
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment