index 6f4c03f6abd7fdb407e512a073bae48f44f542cd..b0032ea67a9fd869b658fa3e984c38007a6250d6 100644 (file)
--- a/tig.c
+++ b/tig.c
unsigned char bytes;
size_t i;
- while (is_initial_sep(*author))
+ while (author < end && is_initial_sep(*author))
author++;
bytes = utf8_char_length(author, end);
- if (bytes < sizeof(initials) - 1 - pos) {
- while (bytes--) {
- initials[pos++] = *author++;
- }
+ if (bytes >= sizeof(initials) - 1 - pos)
+ break;
+ while (bytes--) {
+ initials[pos++] = *author++;
}
- for (i = pos; author < end && !is_initial_sep(*author); author++) {
- if (i < sizeof(initials) - 1)
- initials[i++] = *author;
+ i = pos;
+ while (author < end && !is_initial_sep(*author)) {
+ bytes = utf8_char_length(author, end);
+ if (bytes >= sizeof(initials) - 1 - i) {
+ while (author < end && !is_initial_sep(*author))
+ author++;
+ break;
+ }
+ while (bytes--) {
+ initials[i++] = *author++;
+ }
}
initials[i++] = 0;
free(blame->commit);
}
- string_format(view->vid, "%s:%s", opt_ref, opt_file);
+ string_format(view->vid, "%s", opt_file);
string_format(view->ref, "%s ...", opt_file);
return TRUE;