std::istream::get() returns std::istream::traits_type::eof()
Change-Id: I0461e8184e4ad2a9d2dff89879e141bd66555bf5
This commit is contained in:
@@ -491,7 +491,7 @@ static int next_token(MzString &white, MzString &token, istream *strm)
|
|||||||
|
|
||||||
token = nullptr;
|
token = nullptr;
|
||||||
white = nullptr;
|
white = nullptr;
|
||||||
if( !strm->good() || (ch = strm->get()) == EOF )
|
if( !strm->good() || (ch = strm->get()) == std::istream::traits_type::eof() )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// read preceding ws
|
// read preceding ws
|
||||||
@@ -508,7 +508,8 @@ static int next_token(MzString &white, MzString &token, istream *strm)
|
|||||||
do {
|
do {
|
||||||
token << (char) ch;
|
token << (char) ch;
|
||||||
ch = strm->get();
|
ch = strm->get();
|
||||||
} while( ch != EOF && (ch & 0x80 || isalpha(ch)) ) ;
|
} while( ch != std::istream::traits_type::eof()
|
||||||
|
&& (ch & 0x80 || isalpha(ch)) ) ;
|
||||||
strm->putback(sal::static_int_cast<char>(ch));
|
strm->putback(sal::static_int_cast<char>(ch));
|
||||||
/* special treatment of sub, sub, over, atop
|
/* special treatment of sub, sub, over, atop
|
||||||
The reason for this is that affect next_state().
|
The reason for this is that affect next_state().
|
||||||
@@ -722,7 +723,8 @@ static char eq2ltxconv(MzString& sstr, istream *strm, const char *sentinel)
|
|||||||
sstr.replace(pos, ' ');
|
sstr.replace(pos, ' ');
|
||||||
}
|
}
|
||||||
sstr << token;
|
sstr << token;
|
||||||
while( (ch = strm->get()) != EOF && IS_WS(ch) )
|
while( (ch = strm->get()) != std::istream::traits_type::eof()
|
||||||
|
&& IS_WS(ch) )
|
||||||
sstr << (char)ch;
|
sstr << (char)ch;
|
||||||
if( ch != '{' )
|
if( ch != '{' )
|
||||||
sstr << "{}";
|
sstr << "{}";
|
||||||
|
Reference in New Issue
Block a user