diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index 90e76ae420389da34c43fd00a665b913d6d503e3..5f9f3f09b11b2e7f54a26bdbce7cb0e6974740d5 100644 (file)
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
return -1;
}
return -1;
}
+const char *format_subject(struct strbuf *sb, const char *msg,
+ const char *line_separator);
+
static void insert_one_record(struct shortlog *log,
const char *author,
const char *oneline)
static void insert_one_record(struct shortlog *log,
const char *author,
const char *oneline)
size_t len;
const char *eol;
const char *boemail, *eoemail;
size_t len;
const char *eol;
const char *boemail, *eoemail;
+ struct strbuf subject = STRBUF_INIT;
boemail = strchr(author, '<');
if (!boemail)
boemail = strchr(author, '<');
if (!boemail)
while (*oneline && isspace(*oneline) && *oneline != '\n')
oneline++;
len = eol - oneline;
while (*oneline && isspace(*oneline) && *oneline != '\n')
oneline++;
len = eol - oneline;
- while (len && isspace(oneline[len-1]))
- len--;
- buffer = xmemdupz(oneline, len);
+ format_subject(&subject, oneline, " ");
+ buffer = strbuf_detach(&subject, NULL);
if (dot3) {
int dot3len = strlen(dot3);
if (dot3) {
int dot3len = strlen(dot3);