Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
7f126019
Commit
7f126019
authored
Nov 15, 2000
by
Francois Gouget
Committed by
Alexandre Julliard
Nov 15, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow the user to stick the option and its argument together.
parent
4b43b4d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
main.c
tools/winebuild/main.c
+24
-5
No files found.
tools/winebuild/main.c
View file @
7f126019
...
@@ -167,21 +167,40 @@ static void do_lib( const char *arg )
...
@@ -167,21 +167,40 @@ static void do_lib( const char *arg )
static
void
parse_options
(
char
*
argv
[]
)
static
void
parse_options
(
char
*
argv
[]
)
{
{
const
struct
option
*
opt
;
const
struct
option
*
opt
;
int
i
;
char
*
const
*
ptr
;
const
char
*
arg
=
NULL
;
for
(
i
=
1
;
argv
[
i
];
i
++
)
ptr
=
argv
+
1
;
while
(
*
ptr
!=
NULL
)
{
{
for
(
opt
=
option_table
;
opt
->
name
;
opt
++
)
for
(
opt
=
option_table
;
opt
->
name
;
opt
++
)
if
(
!
strcmp
(
argv
[
i
],
opt
->
name
))
break
;
{
if
(
opt
->
has_arg
&&
!
strncmp
(
*
ptr
,
opt
->
name
,
strlen
(
opt
->
name
)
))
{
arg
=*
ptr
+
strlen
(
opt
->
name
);
if
(
*
arg
==
'\0'
)
{
ptr
++
;
arg
=*
ptr
;
}
break
;
}
if
(
!
strcmp
(
*
ptr
,
opt
->
name
))
{
arg
=
NULL
;
break
;
}
}
if
(
!
opt
->
name
)
if
(
!
opt
->
name
)
{
{
fprintf
(
stderr
,
"Unrecognized option '%s'
\n
"
,
argv
[
i
]
);
fprintf
(
stderr
,
"Unrecognized option '%s'
\n
"
,
*
ptr
);
do_usage
();
do_usage
();
}
}
if
(
opt
->
has_arg
&&
arg
v
[
i
+
1
])
opt
->
func
(
argv
[
++
i
]
);
if
(
opt
->
has_arg
&&
arg
!=
NULL
)
opt
->
func
(
arg
);
else
opt
->
func
(
""
);
else
opt
->
func
(
""
);
ptr
++
;
}
}
}
}
...
...
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