From 71dcbc9ace1b2fe4052bdf8c367dbf89180f7321 Mon Sep 17 00:00:00 2001 From: Nicky Date: Tue, 19 Aug 2014 17:44:43 +0200 Subject: [PATCH] Use unicode versions of isspace and isalnum as the ANSI versions are not defined for characters greater 0xFF. --- indra/llui/llkeywords.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index b35441d52e..b40a54cac0 100755 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -541,7 +541,11 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW } // Skip white space - while( *cur && isspace(*cur) && (*cur != '\n') ) + + // use iswspace in case *cur > 0xFF + // while( *cur && isspace(*cur) && (*cur != '\n') ) + while( *cur && iswspace(*cur) && (*cur != '\n') ) + // { cur++; } @@ -584,7 +588,11 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW } // Skip white space - while( *cur && isspace(*cur) && (*cur != '\n') ) + + // use iswspace in case *cur > 0xFF + // while( *cur && isspace(*cur) && (*cur != '\n') ) + while( *cur && iswspace(*cur) && (*cur != '\n') ) + // { cur++; } @@ -692,10 +700,10 @@ void LLKeywords::findSegments(std::vector* 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++;