From: Paolo 'Blaisorblade' Giarrusso Date: Fri, 2 Sep 2005 09:25:27 +0000 (+0200) Subject: [PATCH] Fix crash for empty description X-Git-Tag: v0.14.3~691 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/011cbd1b417a29bbcb189f86833bac773ba4a6f7 [PATCH] Fix crash for empty description We access the last character of the description, which may be empty. Use slicing to avoid this crash. Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- diff --git a/stgit/git.py b/stgit/git.py index c8339e0..40bcd78 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -299,7 +299,7 @@ def commit(message, files = [], parents = [], allowempty = False, # get the commit message f = file('.commitmsg', 'w+') - if message[-1] == '\n': + if message[-1:] == '\n': f.write(message) else: print >> f, message