summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-09-27 11:15:50 +0300
committerLars Wirzenius <liw@liw.fi>2015-09-27 11:15:50 +0300
commitd629ca9326f4693440b39f5fa73d62834279edbc (patch)
tree94043fdf691c9256f986ee5579927df26b2289f5
parent25ddb866268f0b3d1798c1de81b65e7a6cf33e61 (diff)
downloadttystatus-d629ca9326f4693440b39f5fa73d62834279edbc.tar.gz
Don't write anything if empty string
This avoids a bug where an app writes nothing, setting _first_output to false, and then write something, and not getting enough space for that, because the flag's already false.
-rw-r--r--ttystatus/messager.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ttystatus/messager.py b/ttystatus/messager.py
index d5dce46..f4cd143 100644
--- a/ttystatus/messager.py
+++ b/ttystatus/messager.py
@@ -99,6 +99,8 @@ class Messager(object):
def write(self, string):
'''Write raw data, always.'''
+ if not string:
+ return
self.update_width()
rows = string.split('\n')