summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-03-08 09:00:40 -0500
committermidipix <writeonce@midipix.org>2016-11-11 00:22:37 -0500
commitefe8d22e3d3930b3001a96dcf46d775bdbbc7418 (patch)
tree10701e16933ce25a6d46b4161c61c968b9a1458a /src
parentbf01203108359fdf1bce88f124f4f211095bf90c (diff)
downloadmdso-efe8d22e3d3930b3001a96dcf46d775bdbbc7418.tar.bz2
mdso-efe8d22e3d3930b3001a96dcf46d775bdbbc7418.tar.xz
argv.h: test for ARGV_OPTION_HYBRID_ONLY before accepting arg-less options.
Diffstat (limited to 'src')
-rw-r--r--src/internal/argv/argv.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h
index 57ab864..85ddf92 100644
--- a/src/internal/argv/argv.h
+++ b/src/internal/argv/argv.h
@@ -381,15 +381,15 @@ static void argv_scan(
if (fhybrid && !(option->flags & ARGV_OPTION_HYBRID_SWITCH))
ferr = ARGV_ERROR_HYBRID_NONE;
+ else if (!fhybrid && (option->flags & ARGV_OPTION_HYBRID_ONLY))
+ ferr = ARGV_ERROR_HYBRID_ONLY;
else if (option->optarg == ARGV_OPTARG_NONE) {
if (val[0]) {
ferr = ARGV_ERROR_OPTARG_NONE;
ctx->errch = val + 1;
} else
fval = false;
- } else if (!fhybrid && (option->flags & ARGV_OPTION_HYBRID_ONLY))
- ferr = ARGV_ERROR_HYBRID_ONLY;
- else if (val[0] && (option->flags & ARGV_OPTION_HYBRID_JOINED)) {
+ } else if (val[0] && (option->flags & ARGV_OPTION_HYBRID_JOINED)) {
fval = true;
ch = val;
} else if (fhybrid && !val[0] && !(option->flags & ARGV_OPTION_HYBRID_SPACE))