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

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
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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 );
}