Commit 3a8bf14c authored by jean-pierre charras's avatar jean-pierre charras

Fix an issue (only found using gcc under mingw) in dsnlexer.cpp, using...

Fix an issue (only found using gcc under mingw) in dsnlexer.cpp, using ::isspace( ) function that accepts only a 7 bit ASCII value under gcc/ mingw.
parent 025d5509
......@@ -374,8 +374,13 @@ int DSNLEXER::NeedNUMBER( const char* aExpectation ) throw( IO_ERROR )
*/
static inline bool isSpace( int cc )
{
// make sure int passed to ::isspace() is 0-255
return ::isspace( cc & 0xff );
// Warning: we are using UTF8 char, so values are coded from 0x01 to 0xFF
// isspace( int value ) works fine under Linux,
// but seems use only a 7 bits value under mingw, in comparisons.
// (for instance 0xA0 is seen as 0x20)
// So we need to test if the value is ASCII ( <= 127) and a space ( ' ', \t, \n ... )
// and not just a space:
return ( (unsigned) cc <= 127 ) && ::isspace( cc );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment