Jeff King <peff@xxxxxxxx> writes: > +const char *find_commit_header(const char *msg, const char *key, size_t *out_len) > +{ > + int key_len = strlen(key); > + const char *line = msg; > + > + while (line) { > + const char *eol = strchrnul(line, '\n'); > + > + if (line == eol) > + return NULL; > + > + if (eol - line > key_len && > + !strncmp(line, key, key_len) && > + line[key_len] == ' ') { > + *out_len = eol - line - key_len - 1; > + return line + key_len + 1; Hmph. Does this have to worry about continuation lines in the header part e.g. mergetag? If the original in pretty.c was only about the encoding, it may not have mattered, but now because it is made public, it may matter more. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html