From 2c8b3306541cdc86fcad899ea8957099453c6721 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 27 Jan 2024 21:22:54 +0000 Subject: argv.h: argv_scan(): properly handle (fhybrid && ARGV_OPTARG_OPTIONAL). --- src/internal/argv/argv.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/internal/argv') diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h index 4cb6b6a..c96cfc5 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; -- cgit v1.2.3