mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-31 03:40:33 +05:00
Fix support of old format libraries for hypothezis
This commit is contained in:
parent
8bbd05c3d4
commit
0a2050d0aa
@ -319,19 +319,22 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName
|
|||||||
{
|
{
|
||||||
int libNameLen = strlen(theLibName);
|
int libNameLen = strlen(theLibName);
|
||||||
//check for old format "libXXXXXXX.so"
|
//check for old format "libXXXXXXX.so"
|
||||||
if( !strncmp( theLibName, "lib", 3 ) && !strcmp( theLibName+libNameLen-4, ".so" ) && libNameLen > 7 )
|
if( libNameLen > 7 && !strncmp( theLibName, "lib", 3 ) && !strcmp( theLibName+libNameLen-3, ".so" ) )
|
||||||
{
|
{
|
||||||
//the old format
|
//the old format
|
||||||
#ifdef WNT
|
#ifdef WNT
|
||||||
aPlatformLibName = new char[libNameLen - 2];
|
aPlatformLibName = new char[libNameLen - 1];
|
||||||
aPlatformLibName[0] = '\0';
|
aPlatformLibName[0] = '\0';
|
||||||
aPlatformLibName = strncat( aPlatformLibName, theLibName+3, libNameLen-6 );
|
aPlatformLibName = strncat( aPlatformLibName, theLibName+3, libNameLen-6 );
|
||||||
aPlatformLibName = strcat( aPlatformLibName, ".dll" );
|
aPlatformLibName = strcat( aPlatformLibName, ".dll" );
|
||||||
|
aPlatformLibName[libNameLen - 2] = '\0';
|
||||||
#else
|
#else
|
||||||
aPlatformLibName = new char[ libNameLen ];
|
aPlatformLibName = new char[ libNameLen + 1];
|
||||||
aPlatformLibName[0] = '\0';
|
aPlatformLibName[0] = '\0';
|
||||||
aPlatformLibName = strcat( aPlatformLibName, theLibName );
|
aPlatformLibName = strcat( aPlatformLibName, theLibName );
|
||||||
|
aPlatformLibName[libNameLen] = '\0';
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user