diff options
author | midipix <writeonce@midipix.org> | 2024-01-27 21:22:54 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-01-27 22:20:41 +0000 |
commit | 6dd82b62d635155b4845595a9762f8060c4c6c65 (patch) | |
tree | 2ba01e46adf82b315db3fcda96ee3a07e0ce6a8f /src | |
parent | 8d903767d10a772e185c9ae368b34981ecd6c8d5 (diff) | |
download | ntux-6dd82b62d635155b4845595a9762f8060c4c6c65.tar.bz2 ntux-6dd82b62d635155b4845595a9762f8060c4c6c65.tar.xz |
argv.h: argv_scan(): properly handle (fhybrid && ARGV_OPTARG_OPTIONAL).
Diffstat (limited to 'src')
-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 0e8087f..2d9ef08 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; |