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:
parent
a2a04a726a
commit
5666d5b1b0
1 changed files with 9 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue