Commit 711bb1324928686dc0d198cfa76680ecefce91ac

Stefan Sperling 2019-03-09T13:26:10

show author's email handle instead of full name in tog log view

diff --git a/tog/tog.c b/tog/tog.c
index e3e4b93..c1a08e9 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -930,11 +930,11 @@ draw_commit(struct tog_view *view, struct got_commit_object *commit,
 	char *author0 = NULL, *author = NULL;
 	wchar_t *wlogmsg = NULL, *wauthor = NULL;
 	int author_width, logmsg_width;
-	char *newline, *smallerthan;
+	char *newline, *smallerthan, *at;
 	char *line = NULL;
 	int col, limit;
 	static const size_t date_display_cols = 9;
-	static const size_t author_display_cols = 16;
+	static const size_t author_display_cols = 10;
 	const int avail = view->ncols;
 	struct tm tm;
 	time_t committer_time;
@@ -962,13 +962,11 @@ draw_commit(struct tog_view *view, struct got_commit_object *commit,
 	}
 	author = author0;
 	smallerthan = strchr(author, '<');
-	if (smallerthan)
-		*smallerthan = '\0';
-	else {
-		char *at = strchr(author, '@');
-		if (at)
-			*at = '\0';
-	}
+	if (smallerthan && smallerthan[1] != '\0')
+		author = smallerthan + 1;
+	at = strchr(author, '@');
+	if (at)
+		*at = '\0';
 	limit = avail - col;
 	err = format_line(&wauthor, &author_width, author, limit);
 	if (err)