Code

Fix problem with empty space when the author field is disabled
authorJonas Fonseca <fonseca@diku.dk>
Thu, 14 Apr 2011 00:35:40 +0000 (20:35 -0400)
committerJonas Fonseca <fonseca@diku.dk>
Thu, 14 Apr 2011 00:35:40 +0000 (20:35 -0400)
tig.c

diff --git a/tig.c b/tig.c
index dd9437f5f39f29d3da373c80e9df443571d68adc..2049789b5fe020a599540f872dcb1becd3969ff5 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -187,7 +187,7 @@ mkauthor(const char *text, int cols, enum author author)
        bool trim = author_trim(cols);
        bool abbreviate = author == AUTHOR_ABBREVIATED || !trim;
 
-       if (!author)
+       if (author == AUTHOR_NO)
                return "";
        if (abbreviate && text)
                return get_author_initials(text);
@@ -1651,6 +1651,9 @@ draw_author(struct view *view, const char *author)
        bool trim = author_trim(opt_author_cols);
        const char *text = mkauthor(author, opt_author_cols, opt_author);
 
+       if (opt_author == AUTHOR_NO)
+               return FALSE;
+
        return draw_field(view, LINE_AUTHOR, text, opt_author_cols, trim);
 }