summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_alias.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index 522259ebd..747a3ee93 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -316,13 +316,14 @@ class ModuleAlias : public Module
std::string var = "$";
var.append(ConvToStr(v));
var.append("-");
+ std::string repl = GetVar(var, original_line);
std::string::size_type x = newline.find(var);
while (x != std::string::npos)
{
newline.erase(x, var.length());
- newline.insert(x, GetVar(var, original_line));
- x = newline.find(var);
+ newline.insert(x, repl);
+ x = newline.find(var, x + repl.length());
}
var = "$";
@@ -332,8 +333,8 @@ class ModuleAlias : public Module
while (x != std::string::npos)
{
newline.erase(x, var.length());
- newline.insert(x, GetVar(var, original_line));
- x = newline.find(var);
+ newline.insert(x, repl);
+ x = newline.find(var, x + repl.length());
}
}