Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
c53ccfe9
...
c53ccfe92c9d421fbdf9938f604cf69b36e59397
authored
2002-09-23 07:50:20 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mh_argp_parse): Complain about non-processed arguments unless "index" is non-null.
1 parent
b6e76332
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
mh/mh_argp.c
mh/mh_argp.c
View file @
c53ccfe
...
...
@@ -72,12 +72,14 @@ mh_argp_parse (int argc, char **argv,
struct
argp_option
*
option
,
struct
mh_option
*
mh_option
,
char
*
argp_doc
,
char
*
doc
,
int
(
*
handler
)(),
void
*
closure
,
int
*
index
)
int
(
*
handler
)(),
void
*
closure
,
int
*
p
index
)
{
struct
argp
argp
;
struct
mh_argp_data
data
;
char
*
p
;
int
index
;
int
extra
=
0
;
program_invocation_name
=
argv
[
0
];
p
=
strrchr
(
argv
[
0
],
'/'
);
if
(
p
)
...
...
@@ -120,11 +122,22 @@ mh_argp_parse (int argc, char **argv,
for
(;
i
<
_argc
;
i
++
)
_argv
[
i
]
=
xargv
[
i
-
argc
];
_argv
[
i
]
=
NULL
;
argp_parse
(
&
argp
,
_argc
,
_argv
,
0
,
index
,
&
data
);
argp_parse
(
&
argp
,
_argc
,
_argv
,
0
,
&
index
,
&
data
);
free
(
_argv
);
extra
=
index
<
_argc
;
}
else
argp_parse
(
&
argp
,
argc
,
argv
,
0
,
index
,
&
data
);
{
argp_parse
(
&
argp
,
argc
,
argv
,
0
,
&
index
,
&
data
);
extra
=
index
<
argc
;
}
if
(
pindex
)
*
pindex
=
index
;
else
if
(
extra
)
{
mh_error
(
"extra arguments"
);
exit
(
1
);
}
mh_init2
();
return
0
;
}
...
...
Please
register
or
sign in
to post a comment