summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-03-08 09:00:40 -0500
committermidipix <writeonce@midipix.org>2016-11-10 23:35:40 -0500
commit9b44da0730710a0b6ebe4277cd59e8d7ee7044be (patch)
treedffb78010174d1bdbdfd70e9829840f888c1e9c0
parent59e14411d4e4bd3dcde7275f6dd657857c706471 (diff)
downloadperk-9b44da0730710a0b6ebe4277cd59e8d7ee7044be.tar.bz2
perk-9b44da0730710a0b6ebe4277cd59e8d7ee7044be.tar.xz
argv.h: test for ARGV_OPTION_HYBRID_ONLY before accepting arg-less options.
-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 a4df572..cf24c56 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))