summaryrefslogtreecommitdiff
path: root/src/internal
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:37 +0000
commit1a16fbae9904c4cdd5786dba163e5e82e693f756 (patch)
tree5c5f7e5a222efb2840bf7fe0346c0f903cd7a88b /src/internal
parentd155298c21574414238fd644718e039977bc2375 (diff)
downloadmdso-1a16fbae9904c4cdd5786dba163e5e82e693f756.tar.bz2
mdso-1a16fbae9904c4cdd5786dba163e5e82e693f756.tar.xz
argv.h: argv_scan(): properly handle (fhybrid && ARGV_OPTARG_OPTIONAL).
Diffstat (limited to 'src/internal')
-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 99c2ecc..0be1d0e 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;