Salome HOME
projects
/
modules
/
smesh.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e85e13e
)
Protection for the case of python command wrapped over several lines
author
eap
<eap@opencascade.com>
Fri, 31 Jul 2020 17:27:23 +0000
(20:27 +0300)
committer
eap
<eap@opencascade.com>
Fri, 31 Jul 2020 17:27:23 +0000
(20:27 +0300)
src/SMESH_I/SMESH_2smeshpy.cxx
patch
|
blob
|
history
diff --git
a/src/SMESH_I/SMESH_2smeshpy.cxx
b/src/SMESH_I/SMESH_2smeshpy.cxx
index 9ad3852900d66c165bb880333b877e68b24c077c..b36b31c13ea6f5d95e6836ef8329aeba6a9ed0f3 100644
(file)
--- a/
src/SMESH_I/SMESH_2smeshpy.cxx
+++ b/
src/SMESH_I/SMESH_2smeshpy.cxx
@@
-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 );
}