summaryrefslogtreecommitdiff
path: root/builtin-blame.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-05 19:40:35 -0800
committerJunio C Hamano <gitster@pobox.com>2009-02-05 19:40:35 -0800
commit9242431ca0e2e9ab95008b29b4d88e7bd72d6257 (patch)
tree644171561184533f9a59d9e575c79401e45ed3c4 /builtin-blame.c
parent74b11bc3beca489502d0840e4c558a5fcc44e145 (diff)
parentffaf9cc0ff0692a0b60cdf1b62e8375706b7865d (diff)
downloadgit-9242431ca0e2e9ab95008b29b4d88e7bd72d6257.tar.gz
Merge branch 'gt/utf8-width'
* gt/utf8-width: builtin-blame.c: Use utf8_strwidth for author's names utf8: add utf8_strwidth()
Diffstat (limited to 'builtin-blame.c')
-rw-r--r--builtin-blame.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/builtin-blame.c b/builtin-blame.c
index aae14ef8bb..9b9f5442a2 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -19,6 +19,7 @@
#include "string-list.h"
#include "mailmap.h"
#include "parse-options.h"
+#include "utf8.h"
static char blame_usage[] = "git blame [options] [rev-opts] [rev] [--] file";
@@ -1618,13 +1619,14 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
printf(" %*d", max_orig_digits,
ent->s_lno + 1 + cnt);
- if (!(opt & OUTPUT_NO_AUTHOR))
- printf(" (%-*.*s %10s",
- longest_author, longest_author,
- ci.author,
+ if (!(opt & OUTPUT_NO_AUTHOR)) {
+ int pad = longest_author - utf8_strwidth(ci.author);
+ printf(" (%s%*s %10s",
+ ci.author, pad, "",
format_time(ci.author_time,
ci.author_tz,
show_raw_time));
+ }
printf(" %*d) ",
max_digits, ent->lno + 1 + cnt);
}
@@ -1755,7 +1757,7 @@ static void find_alignment(struct scoreboard *sb, int *option)
if (!(suspect->commit->object.flags & METAINFO_SHOWN)) {
suspect->commit->object.flags |= METAINFO_SHOWN;
get_commit_info(suspect->commit, &ci, 1);
- num = strlen(ci.author);
+ num = utf8_strwidth(ci.author);
if (longest_author < num)
longest_author = num;
}