summaryrefslogtreecommitdiffhomepage
path: root/src
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:49 +0000
commit2280017374a2e7c5de89869e0e900c21b53a2d94 (patch)
tree7416aa84a02c6c7c4151c6a457b83a06e073c40b /src
parent7762d43f13cc75edd41360130af48be05e85f043 (diff)
downloadptycon-2280017374a2e7c5de89869e0e900c21b53a2d94.tar.bz2
ptycon-2280017374a2e7c5de89869e0e900c21b53a2d94.tar.xz
argv.h: argv_scan(): properly handle (fhybrid && ARGV_OPTARG_OPTIONAL).
Diffstat (limited to 'src')
-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 14db1b1..f43c936 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;