This repository was archived by the owner on Oct 28, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,9 +100,7 @@ namespace detail {
100100 void loadBuffer () {
101101 m_tokenBuffer.resize ( 0 );
102102
103- // Skip any empty strings
104- while ( it != itEnd && it->empty () )
105- ++it;
103+ // Note: not skiping empty strings
106104
107105 if ( it != itEnd ) {
108106 auto const &next = *it;
@@ -962,10 +960,13 @@ namespace detail {
962960 for ( auto const & opt : m_options ) parsers[i++] = &opt;
963961 for ( auto const & arg : m_args ) parsers[i++] = &arg;
964962
965- if ( m_isSubcmd )
966- m_exeName.set ( tokens->token );
967- else
968- m_exeName.set ( exeName );
963+ if (m_isSubcmd) {
964+ if (auto result = m_exeName.set (tokens->token ); !result)
965+ return InternalParseResult (result);
966+ }
967+ else {
968+ m_exeName.set (exeName);
969+ }
969970
970971 auto result = InternalParseResult::ok ( m_isSubcmd ?
971972 ParseState ( ParseResultType::Matched, ++TokenStream ( tokens ) ) :
You can’t perform that action at this time.
0 commit comments