aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-10-23 22:27:20 +0200
committerMattias Andrée <maandree@operamail.com>2012-10-23 22:27:20 +0200
commitbcd88c986259cd5ab2d38d26a2d7e5939725940d (patch)
tree50c3601a9ff4410b4623925c5fd82b55ab3e84d6
parente726084422b59e5167c5cb0fdb5909c753e31e10 (diff)
downloadponysay-bcd88c986259cd5ab2d38d26a2d7e5939725940d.tar.gz
ponysay-bcd88c986259cd5ab2d38d26a2d7e5939725940d.tar.bz2
ponysay-bcd88c986259cd5ab2d38d26a2d7e5939725940d.zip
fix bug that made the program freeze if TAB (\t) is used in the pony file
-rwxr-xr-xponysay.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/ponysay.py b/ponysay.py
index 502b85f..48cbaf7 100755
--- a/ponysay.py
+++ b/ponysay.py
@@ -1510,10 +1510,10 @@ class Backend():
while i < n:
c = self.pony[i]
if c == '\t':
- n += 8 - (indent & 7)
- ed = ' ' * (7 - (indent & 7))
+ n += 7 - (indent & 7)
+ ed = ' ' * (8 - (indent & 7))
c = ' '
- self.pony = self.pony[:i] + ed + self.pony[i:]
+ self.pony = self.pony[:i] + ed + self.pony[i + 1:]
i += 1
if c == '$':
if dollar is not None: