From a16b056dc34d8cf7833440730cc6f9fd267508a3 Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 29 Nov 2017 20:23:15 +0100 Subject: [PATCH] Fix reading value after abbreviation and equation sign --- application/argumentparser.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/application/argumentparser.cpp b/application/argumentparser.cpp index 191f7f3..8f43c24 100644 --- a/application/argumentparser.cpp +++ b/application/argumentparser.cpp @@ -157,14 +157,15 @@ void ArgumentReader::read(ArgumentVector &args) // prepare reading parameter values values = &matchingArg->m_occurrences.back().values; - if (equationPos) { + if ((argDenotationType != Abbreviation && equationPos) || (++argDenotation == equationPos)) { values->push_back(equationPos + 1); + argDenotation = nullptr; } // read sub arguments ++index, ++parser.m_actualArgc, lastArg = lastArgInLevel = matchingArg, lastArgDenotation = argv; - if (argDenotationType != Abbreviation || (++argDenotation != equationPos)) { - if (argDenotationType != Abbreviation || !*argDenotation) { + if (argDenotationType != Abbreviation || (argDenotation != equationPos)) { + if (argDenotationType != Abbreviation || !argDenotation || !*argDenotation) { // no further abbreviations follow -> read sub args for next argv ++argv, argDenotation = nullptr; read(lastArg->m_subArgs);