Salome HOME
Merge branch 'BR_LAND_COVER_MAP' of ssh://git.salome-platform.org/modules/hydro into...
[modules/hydro.git] / src / HYDROData / HYDROData_ShapeFile.cxx
index 42936173613dedc144156dc450b255dd39fbd97a..51ca1b02c5ab08692fce0b120709fed0eb170a96 100644 (file)
@@ -711,6 +711,11 @@ int HYDROData_ShapeFile::TryOpenShapeFile(QString theFileName)
 {
   QString aSHPfile = theFileName.simplified();
   QString aSHXfile = theFileName.simplified().replace( theFileName.simplified().size() - 4, 4, ".shx");
+
+  QString anExt = theFileName.split('.', QString::SkipEmptyParts).back();
+  if (anExt.toLower() != "shp")
+    return -3;
+
   FILE* pFileSHP = NULL;
   pFileSHP = fopen (aSHPfile.toAscii().data(), "r");
   FILE* pFileSHX = NULL;