diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmDocumentationFormatterHTML.cxx | 13 |
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['<'] = "<"; - escapes['>'] = ">"; - escapes['&'] = "&"; - escapes['\n'] = "<br>"; + static std::map<char,std::string> escapes; + if (escapes.empty()) + { + escapes['<'] = "<"; + escapes['>'] = ">"; + escapes['&'] = "&"; + escapes['\n'] = "<br>"; + } if (escapes.find(c) == escapes.end()) { |