mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 13:25:41 +02:00
Fix bug in TokenStream parser
When presented with just '-' it would access the string at position [1]
This commit is contained in:

committed by
Martin Hořeňovský

parent
77eca4e819
commit
02d3304782
@@ -76,7 +76,7 @@ namespace Catch {
|
||||
{ TokenType::Argument,
|
||||
next.substr( delimiterPos + 1, next.size() ) } );
|
||||
} else {
|
||||
if ( next[1] != '-' && next.size() > 2 ) {
|
||||
if ( next.size() > 1 && next[1] != '-' && next.size() > 2 ) {
|
||||
// Combined short args, e.g. "-ab" for "-a -b"
|
||||
for ( size_t i = 1; i < next.size(); ++i ) {
|
||||
m_tokenBuffer.push_back(
|
||||
|
Reference in New Issue
Block a user