author | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 25 Mar 2007 09:10:14 +0000 (11:10 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 25 Mar 2007 09:10:14 +0000 (11:10 +0200) |
1 | 2 | |||
---|---|---|---|---|
Makefile | patch | | diff1 | | diff2 | | blob | history |
tig.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc Makefile
index 9d8c57ba761983a8f8b11cae0df8ea22b4d07fc4,9d8c57ba761983a8f8b11cae0df8ea22b4d07fc4..0052abd39095f1b3d7098557160af96a8a2f3898
+++ b/Makefile
docdir = $(prefix)/share/doc
# DESTDIR=
--LDLIBS = -lcurses
++LDLIBS = -lcurses -liconv
CFLAGS = -Wall -O2
DFLAGS = -g -DDEBUG -Werror
PROGS = tig
diff --cc tig.c
index 1983375ca03a517a6d1408b2488c8814cc4d5a31,affbcec1bd520248604a337524b2e5e6caf3ecdc..8deab13773e0646d6269c71077103e10e79574b8
+++ b/tig.c
case LINE_AUTHOR:
{
+ /* Parse author lines where the name may be empty:
+ * author <email@address.tld> 1138474660 +0100
+ */
char *ident = line + STRING_SIZE("author ");
- char *end = strchr(ident, '<');
+ char *nameend = strchr(ident, '<');
+ char *emailend = strchr(ident, '>');
- if (!commit)
+ if (!commit || !nameend || !emailend)
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;
+ update_rev_graph(graph);
+ graph = graph->next;
+
+ *nameend = *emailend = 0;
+ ident = chomp_string(ident);
+ if (!*ident) {
+ ident = chomp_string(nameend + 1);
+ if (!*ident)
+ ident = "Unknown";
}
- /* End is NULL or ident meaning there's no author. */
- if (end <= ident)
- ident = "Unknown";
-
string_copy(commit->author, ident);
/* Parse epoch and timezone */