on Windows, quote the path passed to the compiler

This commit is contained in:
Guenter Obiltschnig 2012-11-18 23:00:55 +01:00
parent 8b1ea9268b
commit 2cc47b5c02

View File

@ -1,7 +1,7 @@
// //
// Utility.cpp // Utility.cpp
// //
// $Id: //poco/1.4/CppParser/src/Utility.cpp#2 $ // $Id: //poco/1.4/CppParser/src/Utility.cpp#3 $
// //
// Library: CppParser // Library: CppParser
// Package: CppParser // Package: CppParser
@ -202,8 +202,14 @@ std::string Utility::preprocessFile(const std::string& file, const std::string&
} }
StringTokenizer tokenizer(popts, ",;\n", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM); StringTokenizer tokenizer(popts, ",;\n", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
std::vector<std::string> args(tokenizer.begin(), tokenizer.end()); std::vector<std::string> args(tokenizer.begin(), tokenizer.end());
#ifdef _WIN32
std::string quotedFile("\"");
quotedFile += file;
quotedFile += "\"";
args.push_back(quotedFile);
#else
args.push_back(file); args.push_back(file);
#endif
if (!path.empty()) if (!path.empty())
{ {
std::string newPath(Environment::get("PATH")); std::string newPath(Environment::get("PATH"));