Browse Source

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

tags/2021-05-28
ed 6 years ago
parent
commit
5666d5b1b0
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      extras/Projucer/Source/Application/jucer_CommandLine.cpp

+ 9
- 1
extras/Projucer/Source/Application/jucer_CommandLine.cpp View File

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


Loading…
Cancel
Save