Am 16.11.2010 um 11:52 schrieb Vincent van Ravesteijn:

> On Tue, Nov 16, 2010 at 7:56 AM, Stephan Witt <st.w...@gmx.net> wrote:
>> The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be 
>> correct.
> 
> When I grep for "isdigit" I see the following sollution somewhere else
> in the source:
> 
> diff --git a/src/support/lstrings.cpp b/src/support/lstrings.cpp
> index ed2b9f9..2081fd6 100644
> --- a/src/support/lstrings.cpp
> +++ b/src/support/lstrings.cpp
> @@ -325,7 +325,7 @@ bool hasDigit(docstring const & str)
>       for (; cit != end; ++cit) {
>               if (*cit == ' ')
>                       continue;
> -               if (isdigit((*cit)))
> +               if (*cit < 0x80 && isdigit((*cit)))
>                       return true;
>       }
>       return false;
> 
> This will work too I guess.

In the sense of "avoid the crash"...

The purpose of hasDigit() is to test for occurrences of digits to avoid spell 
check of words with digits.
A docstring may very well contain digits coded outside the range of 0x00 .. 
0x7F (ascii 0-9).
Unicode contains more numeral in different encodings.

Stephan

Reply via email to