Browse Source

fixed loading wordforms from old (ver<=28) indexes

git-svn-id: svn://svn.sphinxsearch.com/sphinx/trunk@3210 406a0c4d-033a-0410-8de8-e80135713968
glook 14 years ago
parent
commit
87166cfd78
1 changed files with 8 additions and 7 deletions
  1. 8 7
      src/sphinx.cpp

+ 8 - 7
src/sphinx.cpp

@@ -18054,15 +18054,16 @@ bool CSphDictCRCTraits::LoadWordforms ( const CSphVector<CSphString> & dFiles, c
 			m_dWFFileInfos[i] = pEmbedded->m_dWordformFiles[i];
 	} else
 	{
-		m_dWFFileInfos.Reserve ( m_dWFFileInfos.GetLength() );
+		m_dWFFileInfos.Reserve ( dFiles.GetLength() );
 		CSphSavedFile tFile;
 		ARRAY_FOREACH ( i, dFiles )
-		{
-			if ( GetFileStats ( dFiles[i].cstr(), tFile ) )
-				m_dWFFileInfos.Add ( tFile );
-			else
-				sphWarning ( "index '%s': wordforms file '%s' not found", sIndex, dFiles[i].cstr() );
-		}
+			if ( !dFiles[i].IsEmpty() )
+			{
+				if ( GetFileStats ( dFiles[i].cstr(), tFile ) )
+					m_dWFFileInfos.Add ( tFile );
+				else
+					sphWarning ( "index '%s': wordforms file '%s' not found", sIndex, dFiles[i].cstr() );
+			}
 	}
 
 	if ( !m_dWFFileInfos.GetLength() )