From 3da3c74f6f10af705bf6f5a813de0be2320ecbde Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Fri, 19 Jun 2009 10:20:15 +0300 Subject: [PATCH] Revert "Fix ticket #417 (Crashes in Windows because of invalid char value)" This reverts commit 70db2562f498cd29a310dc88d2b47a232cd89690. See the ticket - the fix was not correct fix. --- src/preprocessor.cpp | 9 --------- test/testpreprocessor.cpp | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/preprocessor.cpp b/src/preprocessor.cpp index 72fff0ac4..ed56198d6 100644 --- a/src/preprocessor.cpp +++ b/src/preprocessor.cpp @@ -261,15 +261,6 @@ std::string Preprocessor::read(std::istream &istr) if (ch == '\n') ++lineno; - // UTF / extended ASCII => The output from the preprocessor should - // only be standard ASCII. - // In C/C++ code the UTF and extented ASCII (8-bit ASCII) can only - // appear in comments, strings and char constants. So the safest thing - // to do is replace it with space char. We CAN'T change string lengths - // by ignoring characters. - if (ch < 0) - ch = ' '; - // Replace assorted special chars with spaces.. if ((ch != '\n') && (std::isspace(ch) || std::iscntrl(ch))) ch = ' '; diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 8f2e4566b..73d5470ab 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -1000,7 +1000,7 @@ private: { const char filedata[] = {'a', (char)200, 0}; std::istringstream istr(filedata); - ASSERT_EQUALS(Preprocessor::read(istr), "a "); + ASSERT_THROW(Preprocessor::read(istr), std::runtime_error); } void define_part_of_func()