summaryrefslogtreecommitdiff
path: root/kernel/register.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/register.cc')
-rw-r--r--kernel/register.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/register.cc b/kernel/register.cc
index 56dc695a..cdba4c36 100644
--- a/kernel/register.cc
+++ b/kernel/register.cc
@@ -545,11 +545,10 @@ struct HelpPass : public Pass {
}
void escape_tex(std::string &tex)
{
- size_t pos = 0;
- while ((pos = tex.find('_', pos)) != std::string::npos) {
+ for (size_t pos = 0; (pos = tex.find('_', pos)) != std::string::npos; pos += 2)
tex.replace(pos, 1, "\\_");
- pos += 2;
- }
+ for (size_t pos = 0; (pos = tex.find('$', pos)) != std::string::npos; pos += 2)
+ tex.replace(pos, 1, "\\$");
}
void write_tex(FILE *f, std::string cmd, std::string title, std::string text)
{