diff options
author | midipix <writeonce@midipix.org> | 2024-01-27 21:22:54 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-01-27 22:21:10 +0000 |
commit | dfa87916e4c2aa38aa8b7b75a85744e2242b5b83 (patch) | |
tree | 91535ec9daddf000424d3226000ed33a6ef46f3c | |
parent | 0bbdab6c3e96a8509e1285bdda041cd187b51faf (diff) | |
download | tpax-dfa87916e4c2aa38aa8b7b75a85744e2242b5b83.tar.bz2 tpax-dfa87916e4c2aa38aa8b7b75a85744e2242b5b83.tar.xz |
argv.h: argv_scan(): properly handle (fhybrid && ARGV_OPTARG_OPTIONAL).
-rw-r--r-- | src/internal/argv/argv.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h index 0ae5867..d66440c 100644 --- a/src/internal/argv/argv.h +++ b/src/internal/argv/argv.h @@ -438,7 +438,12 @@ static void argv_scan( ch = val; } else if (fhybrid && !val[0] && !(option->flags & ARGV_OPTION_HYBRID_SPACE)) { - ferr = ARGV_ERROR_HYBRID_SPACE; + if (option->optarg == ARGV_OPTARG_OPTIONAL) { + fval = false; + + } else { + ferr = ARGV_ERROR_HYBRID_SPACE; + } } else if (fhybrid && (val[0]=='=') && !(option->flags & ARGV_OPTION_HYBRID_EQUAL)) { ferr = ARGV_ERROR_HYBRID_EQUAL; |