X-Git-Url: https://git.distorted.org.uk/~mdw/tig/blobdiff_plain/fa187d6c87100b0c5d626eceb4369eef79176138..cbbf2d1be57f0bbd9eda37f3d5ab7e30d3ae179b:/tig.c diff --git a/tig.c b/tig.c index 8bae0d5..f110dae 100644 --- a/tig.c +++ b/tig.c @@ -2286,10 +2286,22 @@ main_read(struct view *view, char *line) break; if (end) { + char *email = end + 1; + for (; end > ident && isspace(end[-1]); end--) ; + + if (end == ident && *email) { + ident = email; + end = strchr(ident, '>'); + for (; end > ident && isspace(end[-1]); end--) ; + } *end = 0; } + /* End is NULL or ident meaning there's no author. */ + if (end <= ident) + ident = "Unknown"; + string_copy(commit->author, ident); /* Parse epoch and timezone */ @@ -2583,6 +2595,8 @@ init_display(void) /* Leave stdin and stdout alone when acting as a pager. */ FILE *io = fopen("/dev/tty", "r+"); + if (!io) + die("Failed to open /dev/tty"); cursed = !!newterm(NULL, io, io); }