Preprocessor: Fixed bug, read() didn't handle correctly string constants like this: "\""

This commit is contained in:
Reijo Tomperi 2008-12-05 22:18:13 +00:00
parent a669d020cf
commit 345a7f2c9b
1 changed files with 5 additions and 2 deletions

View File

@ -113,7 +113,10 @@ std::string Preprocessor::read(std::istream &istr, const std::string &filename)
if ( ch == '\\' )
{
ch = (char)istr.get();
code << std::string(1,ch);
code << std::string(1,ch);
// Avoid exiting loop if string contains "-characters
ch = 0;
}
} while ( istr.good() && ch != '\"' );
}
@ -139,7 +142,7 @@ std::string Preprocessor::read(std::istream &istr, const std::string &filename)
code << std::string(1, ch);
}
}
return code.str();
}