Protection for the case of python command wrapped over several lines

This commit is contained in:
eap 2020-07-31 20:27:23 +03:00
parent e85e13ee2a
commit dbbd8a2dbe

View File

@ -3939,7 +3939,7 @@ int _pyCommand::GetArgBeginning() const
if ( pos == UNKNOWN ) if ( pos == UNKNOWN )
{ {
pos = GetBegPos( METHOD_IND ) + myMeth.Length(); pos = GetBegPos( METHOD_IND ) + myMeth.Length();
if ( pos < 1 ) if ( pos < 1 && Length() >= 4 )
pos = myString.Location( "(", 4, Length() ); // 4 = strlen("b.c(") pos = myString.Location( "(", 4, Length() ); // 4 = strlen("b.c(")
} }
return pos; return pos;
@ -4024,6 +4024,11 @@ TCollection_AsciiString _pyCommand::GetWord( const _AString & theString,
} }
theStartPos = beg; theStartPos = beg;
//cout << theString << " ---- " << beg << " - " << end << endl; //cout << theString << " ---- " << beg << " - " << end << endl;
if ( end > theString.Length() )
{
theStartPos = EMPTY;
return theEmptyString;
}
return theString.SubString( beg, end ); return theString.SubString( beg, end );
} }