The function get_one_line() really returns the line length, not the
whole line, but it is really useful, so do not hide it in commit.c,
under the wrong name.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
commit.c | 10 +++++-----
commit.h | 1 +
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/commit.c b/commit.c
index 4c5dfa9..0c350bc 100644
--- a/commit.c
+++ b/commit.c
@@ -458,7 +458,7 @@ void clear_commit_marks(struct commit *commit, unsigned int mark)
/*
* Generic support for pretty-printing the header
*/
-static int get_one_line(const char *msg, unsigned long len)
+int get_line_length(const char *msg, unsigned long len)
{
int ret = 0;
@@ -950,7 +950,7 @@ static void pp_header(enum cmit_fmt fmt,
for (;;) {
const char *line = *msg_p;
char *dst;
- int linelen = get_one_line(*msg_p, *len_p);
+ int linelen = get_line_length(*msg_p, *len_p);
unsigned long len;
if (!linelen)
@@ -1041,7 +1041,7 @@ static void pp_title_line(enum cmit_fmt fmt,
title = xmalloc(title_alloc);
for (;;) {
const char *line = *msg_p;
- int linelen = get_one_line(line, *len_p);
+ int linelen = get_line_length(line, *len_p);
*msg_p += linelen;
*len_p -= linelen;
@@ -1118,7 +1118,7 @@ static void pp_remainder(enum cmit_fmt fmt,
int first = 1;
for (;;) {
const char *line = *msg_p;
- int linelen = get_one_line(line, *len_p);
+ int linelen = get_line_length(line, *len_p);
*msg_p += linelen;
*len_p -= linelen;
@@ -1214,7 +1214,7 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt,
/* Skip excess blank lines at the beginning of body, if any... */
for (;;) {
- int linelen = get_one_line(msg, len);
+ int linelen = get_line_length(msg, len);
int ll = linelen;
if (!linelen)
break;
diff --git a/commit.h b/commit.h
index 467872e..fc6df23 100644
--- a/commit.h
+++ b/commit.h
@@ -60,6 +60,7 @@ enum cmit_fmt {
CMIT_FMT_UNSPECIFIED,
};
+extern int get_line_length(const char *msg, unsigned long len);
extern enum cmit_fmt get_commit_format(const char *arg);
extern unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *, unsigned long len, char **buf_p, unsigned long *space_p, int abbrev, const char *subject, const char *after_subject, enum date_mode dmode);
--
1.5.3.rc1.2718.gd2dc9-dirty
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Linus Torvalds | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Chuck Ebbert | Why do so many machines need "noapic"? |
| Tvrtko A. Ursulin | Western Digital GreenPower drives and Linux |
git: | |
| Shawn O. Pearce | [BULLS**T PATCH] Allow Git to work at Insane Bank Corp |
| Michael Hendricks | removing content from git history |
| Eivind LM | Split a subversion repo into several git repos |
| Nicolas Pitre | Re: [PATCH] gc: call "prune --expire 2.weeks.ago" |
| Joachim Schipper | Re: OpenBSD/alpha Status |
| Cabillot Julien | Re: OpenBSD isakmpd and pf vs Cisco PIX or ASA |
| Marco Peereboom | Re: DELL PERC 5iR slow performance |
| Travers Buda | Re: Important OpenBSD errata |
| Rik Faith | ATI VGA WONDER driver for x386 |
| Mark Tarrabain | Some thoughts on device drivers |
| Karl J. Vesterling | Re: BYTE asks, is UNIX dead? |
| Linus Torvalds | Re: Copyright |
| SMDK2410 LCD Framebuffer driver | 3 hours ago | Linux kernel |
| Resetting the bios password for Toshiba Laptop | 3 hours ago | Hardware |
| Problem booting a barebone kernel in VMWare | 6 hours ago | Linux kernel |
| IP layer send packet | 11 hours ago | Linux kernel |
| PID to ELF image full path | 13 hours ago | Linux kernel |
| types of kernel | 1 day ago | Linux kernel |
| magical mounts | 2 days ago | Linux kernel |
| Problem in scim in Fedora 9 | 2 days ago | Linux general |
| The new Western Digital power saving drives | 2 days ago | Hardware |
| Battery Maximizer Software | 3 days ago | Linux kernel |
