Georg Baum wrote:
>> It crashes by design?
> 
> Yes: It tries to do some document stuff even if a read failed. I see it too 
> on linux. I am sure that I did not see it some time ago when I did some 
> lyx2lyx stuff, probably because of an older compiler.

the assert tests the operator[](int pos) access: size()>pos but pos is 0.
On the lyx side it is  *iterCont_[pos];  which eventually does not
produce a crash.

> Jean-Marc, you might want to consider this fix for 1.4.3 or not. It is not 
> too important IMO, since the case that lyx2lyx fails is fortunetaly not 
> that common, but OTOH it is safe IMHO.

When we not apply this patch we should change the error message:
"... but the lyx2lyx script failed to convert it, click OK to crash." ;)

> BTW José, we should try to keep 1.4 lyx2lyx up to date so that it can readf 
> 1.5 files, as we did in the late 1.3.x series.
> 
> 
> Georg
> 
> 
> ------------------------------------------------------------------------
> 
> Index: src/buffer.C
> ===================================================================
> --- src/buffer.C      (Revision 15088)
> +++ src/buffer.C      (Arbeitskopie)
> @@ -556,14 +556,15 @@ bool Buffer::readFile(string const & fil
>       paragraphs().clear();
>       LyXLex lex(0, 0);
>       lex.setFile(filename);
> -     bool ret = readFile(lex, filename);
> +     if (!readFile(lex, filename))
> +             return false;
>  
>       // After we have read a file, we must ensure that the buffer
>       // language is set and used in the gui.
>       // If you know of a better place to put this, please tell me. (Lgb)
>       updateDocLang(params().language);
>  
> -     return ret;
> +     return true;
>  }
>  
>  


-- 
Peter Kümmel

Reply via email to