summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDocumentationFormatterHTML.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/cmDocumentationFormatterHTML.cxx b/Source/cmDocumentationFormatterHTML.cxx
index 175bc8d..7422ef4 100644
--- a/Source/cmDocumentationFormatterHTML.cxx
+++ b/Source/cmDocumentationFormatterHTML.cxx
@@ -32,11 +32,14 @@ static bool cmDocumentationIsHyperlinkChar(char c)
static void cmDocumentationPrintHTMLChar(std::ostream& os, char c)
{
// Use an escape sequence if necessary.
- std::map<char,std::string> escapes;
- escapes['<'] = "&lt;";
- escapes['>'] = "&gt;";
- escapes['&'] = "&amp;";
- escapes['\n'] = "<br>";
+ static std::map<char,std::string> escapes;
+ if (escapes.empty())
+ {
+ escapes['<'] = "&lt;";
+ escapes['>'] = "&gt;";
+ escapes['&'] = "&amp;";
+ escapes['\n'] = "<br>";
+ }
if (escapes.find(c) == escapes.end())
{