Skip to content

Commit

Permalink
Fix command line syntax "--+option" to set an option to its default.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Nov 13, 2023
1 parent 58f749f commit 8b71b29
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions option.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,19 @@ public void scan_option(constant char *s)
* "--" indicates an option name instead of a letter.
*/
if (*s == '-')
{
optname = ++s;
break;
}
/*
* "-+" means set these options back to their defaults.
* (They may have been set otherwise by previous
* options.)
* "-+" or "--+" means set these options back to their defaults.
* (They may have been set otherwise by previous options.)
*/
set_default = (*s == '+');
if (set_default)
s++;
if (optname != NULL)
{
optname = s;
break;
}
continue;
case '+':
/*
Expand Down

0 comments on commit 8b71b29

Please sign in to comment.