On Tue, Nov 16, 2010 at 07:56:55AM +0100, Stephan Witt wrote:
> The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be 
> correct.

Maybe yes, maybe not. isdigit(c) tests whether c is one of 0,1,2,...,9
while iswdigit(wc) tests whether wc is a wide-character code representing
a character of class "digit" in the program's current locale.
So, they both return true for 0,1,2,...,9 but iswdigit() returns true also
when isdigit() returns false.

> The only thing: I don't understand why it should crash with isdigit() instead 
> of iswdigit()...

That could be a platform/compiler related bug.

> Index: src/support/lstrings.cpp
> ===================================================================
> --- src/support/lstrings.cpp  (Revision 36309)
> +++ src/support/lstrings.cpp  (Arbeitskopie)
> @@ -323,9 +323,7 @@
>       docstring::const_iterator cit = str.begin();
>       docstring::const_iterator const end = str.end();
>       for (; cit != end; ++cit) {
> -             if (*cit == ' ')
> -                     continue;
> -             if (isdigit((*cit)))
> +             if (iswdigit((*cit)))
>                       return true;
>       }
>       return false;

-- 
Enrico

Reply via email to