Am 02.07.2010 um 09:03 schrieb sw...@lyx.org:

> Author: switt
> Date: Fri Jul  2 09:03:15 2010
> New Revision: 34742
> URL: http://www.lyx.org/trac/changeset/34742
> 
> Log:
> add checks for empty word list to avoid crashes later in MyThes::binsearch()
> 
> Modified:
>   lyx-devel/trunk/src/support/mythes/mythes.cxx
> 
> Modified: lyx-devel/trunk/src/support/mythes/mythes.cxx
> ==============================================================================
> --- lyx-devel/trunk/src/support/mythes/mythes.cxx     Thu Jul  1 22:58:26 
> 2010        (r34741)
> +++ lyx-devel/trunk/src/support/mythes/mythes.cxx     Fri Jul  2 09:03:15 
> 2010        (r34742)
> @@ -174,6 +174,9 @@
>     // handle the case of missing file or file related errors
>     if (! pdfile) return 0;
> 
> +    // handle the case if empty word list
> +    if (nw <= 0) return 0;
> +
>     long offset = 0;
> 
>     /* copy search word and make sure null terminated */
> @@ -337,6 +340,7 @@
> int MyThes::binsearch(char * sw, char* list[], int nlst) 
> {
>     int lp, up, mp, j, indx;
> +    if (0==nlst) return -1;
>     lp = 0;
>     up = nlst-1;
>     indx = -1;

I tried to incorporate some thesaurus files from OpenOffice. It seems like the 
file format has changed and is incompatible now. So the old thesaurus .idx and 
.dat files are found but not valid and then LyX crashes. To avoid this I added 
the checks above.
But the question is: where to get actual .idx and .dat files from?
I'll try the files from 
http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries...

Stephan

Reply via email to