summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpttbbs/daemon/banipd/banipd.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pttbbs/daemon/banipd/banipd.py b/pttbbs/daemon/banipd/banipd.py
index 4ba0fcb7..773eb99c 100755
--- a/pttbbs/daemon/banipd/banipd.py
+++ b/pttbbs/daemon/banipd/banipd.py
@@ -51,10 +51,12 @@ def LoadConfigTable(filename):
for ip in ips:
if ip in table:
raise ValueError('duplicated IP: %s' % ip)
- table[ip] = self.text
+ table[ip] = self.text.rstrip() + "\n"
self.clear()
def add_ip(self, s):
+ if '#' in s:
+ s = s.partition('#')[0]
self.ip += ' ' + s
def add_text(self, s):