1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Projucer: Escape single quote marks in the function generated by the --obfuscated-string-code command-line tool

This commit is contained in:
ed 2019-03-11 12:38:21 +00:00
parent a2a04a726a
commit 5666d5b1b0

View file

@ -541,8 +541,16 @@ namespace
out << " String " << name << "; " << name;
auto escapeIfSingleQuote = [] (const String& s) -> String
{
if (s == "\'")
return "\\'";
return s;
};
for (int i = 0; i < text.length(); ++i)
out << " << '" << String::charToString (text[i]) << "'";
out << " << '" << escapeIfSingleQuote (String::charToString (text[i])) << "'";
out << ";" << preferredLineFeed;
}