Merge topic 'xcode-improve-quoting'

2eee2943 Xcode: Invert quoting logic to whitelist of characters
This commit is contained in:
Brad King 2015-08-05 13:54:38 -04:00 committed by CMake Topic Stage
commit 863b0a8ee9
1 changed files with 5 additions and 1 deletions

View File

@ -243,7 +243,11 @@ void cmXCodeObject::PrintString(std::ostream& os,std::string String)
bool needQuote =
(String.empty() ||
String.find("//") != String.npos ||
String.find_first_of(" <>+-*=@[](){},~") != String.npos);
String.find_first_not_of(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789"
"$_./") != String.npos);
const char* quote = needQuote? "\"" : "";
// Print the string, quoted and escaped as necessary.