From 26a0dbeab9ad5fef1d8c1af6b39882282f787dd7 Mon Sep 17 00:00:00 2001 From: asl Date: Tue, 25 Apr 2006 12:32:31 +0000 Subject: [PATCH] more precise determination of file version --- src/Session/SALOME_Session_Server.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 0ef468bee..02741922e 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -190,7 +190,7 @@ protected: virtual int userFileId( const QString& _fname ) const { QRegExp exp( "\\.SalomeApprc\\.([a-zA-Z0-9.]+)$" ); - QRegExp vers_exp( "^([0-9]+)([A-Za-z]?)([0-9]*)" ); + QRegExp vers_exp( "^([0-9]+)([A-Za-z]?)([0-9]*)$" ); QString fname = QFileInfo( _fname ).fileName(); if( exp.exactMatch( fname ) ) @@ -199,7 +199,8 @@ protected: int major=0, minor=0; major = vers[0].toInt(); minor = vers[1].toInt(); - vers_exp.search( vers[2] ); + if( vers_exp.search( vers[2] )==-1 ) + return -1; int release = 0, dev1 = 0, dev2 = 0; release = vers_exp.cap( 1 ).toInt(); dev1 = vers_exp.cap( 2 )[ 0 ].latin1(); -- 2.39.2