From f291ebe76bf33c7b4cbbb15db58cc9e2c901dc5d Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 8 Mar 2016 09:00:40 -0500 Subject: argv.h: test for ARGV_OPTION_HYBRID_ONLY before accepting arg-less options. --- src/internal/argv/argv.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/internal/argv') diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h index 5fd7c88..dc78b2e 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)) -- cgit v1.2.3