mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-24 16:30:34 +05:00
Protection for the case of python command wrapped over several lines
This commit is contained in:
parent
e85e13ee2a
commit
dbbd8a2dbe
@ -3939,7 +3939,7 @@ int _pyCommand::GetArgBeginning() const
|
||||
if ( pos == UNKNOWN )
|
||||
{
|
||||
pos = GetBegPos( METHOD_IND ) + myMeth.Length();
|
||||
if ( pos < 1 )
|
||||
if ( pos < 1 && Length() >= 4 )
|
||||
pos = myString.Location( "(", 4, Length() ); // 4 = strlen("b.c(")
|
||||
}
|
||||
return pos;
|
||||
@ -4024,6 +4024,11 @@ TCollection_AsciiString _pyCommand::GetWord( const _AString & theString,
|
||||
}
|
||||
theStartPos = beg;
|
||||
//cout << theString << " ---- " << beg << " - " << end << endl;
|
||||
if ( end > theString.Length() )
|
||||
{
|
||||
theStartPos = EMPTY;
|
||||
return theEmptyString;
|
||||
}
|
||||
return theString.SubString( beg, end );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user