From 79fec9ee466903273b24613f90089bef762444c8 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Fri, 7 Feb 2014 11:46:13 -0800 Subject: [PATCH] remember: only allow one replacement --- plugins/remember.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/remember.py b/plugins/remember.py index d35f9d5..4a0403e 100644 --- a/plugins/remember.py +++ b/plugins/remember.py @@ -27,7 +27,7 @@ def get_memory(db, chan, word): @hook.command("r") def remember(inp, nick='', chan='', db=None): ".remember [+] s// -- maps word to data in the memory, or " - " does string replacement (not regex)" + " does a string replacement (not regex)" db_init(db) append = False @@ -58,7 +58,7 @@ def remember(inp, nick='', chan='', db=None): if len(args) == 3: replacement = True _, src, dst = args - new_data = _tail.replace(src, dst) + new_data = _tail.replace(src, dst, 1) if new_data == _tail: return 'replacement left data unchanged' tail = new_data