On Sun, Nov 04, 2007 at 05:39:43PM +0100, Jürgen Spitzmüller wrote:
> Andre Poenitz wrote:
> > We definitely should switch to a more user friendly error handling
> > then plain crashs. While it might be annoying that one cannot
> > properly paste form the clipboard we should not crash...
> 
> On Linux, it only crashes with --enable-stdlib-debug. The attached
> patch fixes this particular crash for me, but it's rater a shot in the
> dark.
> 
> Does it make sense, André?

The direction is ok. Probably in the Old Days 'error()' never returned..

> Jürgen

> Index: src/mathed/MathParser.cpp
> ===================================================================
> --- src/mathed/MathParser.cpp (Revision 21417)
> +++ src/mathed/MathParser.cpp (Arbeitskopie)
> @@ -463,8 +463,12 @@
>  
>  char_type Parser::getChar()
>  {
> -     if (!good())
> +     if (!good()) {
>               error("The input stream is not well...");
> +             putback();
> +             char_type dummy;
> +             return dummy;

The last two lines are equivalent to 'return char_type(); '

I am not too sure about the putback(). Would it work without?

If so I'd prefer that otherwise I have a suspicion we might
create endless loops...

Andre'

Reply via email to