summaryrefslogtreecommitdiff
path: root/src/internal/argv
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-01-27 21:22:54 +0000
committermidipix <writeonce@midipix.org>2024-01-27 22:20:44 +0000
commit07a5e61e793acb4fd7fbfd0ec7b9d3939bcf34e7 (patch)
tree0543e47c741aedaf70b8d04c8eb34912411dc0e6 /src/internal/argv
parentc8c85db9250598c1ec215caa2f87a5cee7a65b8d (diff)
downloadperk-07a5e61e793acb4fd7fbfd0ec7b9d3939bcf34e7.tar.bz2
perk-07a5e61e793acb4fd7fbfd0ec7b9d3939bcf34e7.tar.xz
argv.h: argv_scan(): properly handle (fhybrid && ARGV_OPTARG_OPTIONAL).
Diffstat (limited to 'src/internal/argv')
-rw-r--r--src/internal/argv/argv.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h
index 5b565c3..fc25730 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;