From 345a7f2c9b64e95e686ea2b90cf59ea71b837620 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Fri, 5 Dec 2008 22:18:13 +0000 Subject: [PATCH] Preprocessor: Fixed bug, read() didn't handle correctly string constants like this: "\"" --- preprocessor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/preprocessor.cpp b/preprocessor.cpp index b87030dcf..dece75386 100644 --- a/preprocessor.cpp +++ b/preprocessor.cpp @@ -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(); }