diff --git a/src/preprocessor.cpp b/src/preprocessor.cpp index c26d132d6..84d9c0fae 100644 --- a/src/preprocessor.cpp +++ b/src/preprocessor.cpp @@ -865,10 +865,14 @@ std::string Preprocessor::expandMacros(std::string code) { params.push_back(par); par = ""; + } + else if (code[pos2] == ' ') + { + } else if (parlevel >= 1) { - par += std::string(1, code[pos2]); + par.append(1, code[pos2]); } } } diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 68ed554bf..2a45ffa8f 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -108,7 +108,7 @@ private: TEST_CASE(stringify); TEST_CASE(stringify2); - // TODO TEST_CASE(stringify3); + TEST_CASE(stringify3); TEST_CASE(ifdefwithfile); TEST_CASE(pragma); } @@ -703,7 +703,7 @@ private: // Preprocess.. std::string actual = OurPreprocessor::expandMacros(filedata); - ASSERT_EQUALS("\nprintf(\"[0x%lx-0x%lx)\", pstart, pend);", actual); + ASSERT_EQUALS("\nprintf(\"[0x%lx-0x%lx)\",pstart,pend);", actual); } void fmt2()