Use unicode versions of isspace and isalnum as the ANSI versions are not defined for characters greater 0xFF.

Nicky 2014-08-19 17:44:43 +02:00
parent 036c9dd89f
commit 71dcbc9ace
1 changed files with 12 additions and 4 deletions

View File

@ -541,7 +541,11 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
}
// Skip white space
while( *cur && isspace(*cur) && (*cur != '\n') )
// <FS:ND> use iswspace in case *cur > 0xFF
// while( *cur && isspace(*cur) && (*cur != '\n') )
while( *cur && iswspace(*cur) && (*cur != '\n') )
// </FS:ND>
{
cur++;
}
@ -584,7 +588,11 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
}
// Skip white space
while( *cur && isspace(*cur) && (*cur != '\n') )
// <FS:ND> use iswspace in case *cur > 0xFF
// while( *cur && isspace(*cur) && (*cur != '\n') )
while( *cur && iswspace(*cur) && (*cur != '\n') )
// </FS:ND>
{
cur++;
}
@ -692,10 +700,10 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
// check against words
llwchar prev = cur > base ? *(cur-1) : 0;
// NaCl - LSL Preprocessor
if( !isalnum( prev ) && (prev != '_') && (prev != '#'))
if( !iswalnum( prev ) && (prev != '_') && (prev != '#'))
{
const llwchar* p = cur;
while( isalnum( *p ) || (*p == '_') || (*p == '#') )
while( *p && ( iswalnum( *p ) || (*p == '_') || (*p == '#') ) )
// NaCl End
{
p++;