Skip to content
Snippets Groups Projects
Commit 23e3939b authored by Mark A. Grondona's avatar Mark A. Grondona
Browse files

Fix spank_option_getopt in local context

In local context (srun, sbatch, salloc), spank_option_getopt() would
always return that an option was found due to a missing check for
spopt->found in spank_option_getopt.

This patch fixes the issue.
parent 22b16cef
No related branches found
No related tags found
No related merge requests found
......@@ -1528,6 +1528,13 @@ spank_option_getopt (spank_t sp, struct spank_option *opt, char **argp)
(ListFindF) _opt_by_name,
opt->name);
if (spopt) {
/*
* Return failure if option is cached but hasn't been
* used on the command line or specified by user.
*/
if (!spopt->found)
return (ESPANK_ERROR);
if (opt->has_arg && argp)
*argp = spopt->optarg;
return (ESPANK_SUCCESS);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment