Andre Poenitz wrote:
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(); '
Well char_type is an unsigned int so I don't know what char_type() would
return (isn't that undefined behaviour?). I suggest to return 0 instead.
Abdel.