git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] commit.c: Replace starts_with() with skip_prefix()
@ 2014-03-03  7:47 Karthik Nayak
  2014-03-03  8:52 ` Eric Sunshine
  0 siblings, 1 reply; 4+ messages in thread
From: Karthik Nayak @ 2014-03-03  7:47 UTC (permalink / raw)
  To: git; +Cc: Karthik Nayak

Replace with skip_prefix(), which uses the inbuilt function
strcmp() to compare.

Other Places were this can be implemented:
commit.c : line 1117
commit.c : line 1197

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
---
 commit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/commit.c b/commit.c
index 6bf4fe0..1e181cf 100644
--- a/commit.c
+++ b/commit.c
@@ -552,6 +552,7 @@ static void record_author_date(struct author_date_slab *author_date,
 	char *buffer = NULL;
 	struct ident_split ident;
 	char *date_end;
+	char *flag_sp; /* stores return value of skip_prefix() */
 	unsigned long date;
 
 	if (!commit->buffer) {
@@ -566,7 +567,7 @@ static void record_author_date(struct author_date_slab *author_date,
 	     buf;
 	     buf = line_end + 1) {
 		line_end = strchrnul(buf, '\n');
-		if (!starts_with(buf, "author ")) {
+		if ((flag_sp = skip_prefix(buf, "author ")) == NULL) {
 			if (!line_end[0] || line_end[1] == '\n')
 				return; /* end of header */
 			continue;
-- 
1.9.0.138.g2de3478

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-03 23:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-03  7:47 [PATCH] commit.c: Replace starts_with() with skip_prefix() Karthik Nayak
2014-03-03  8:52 ` Eric Sunshine
2014-03-03 15:23   ` karthik nayak
2014-03-03 23:54     ` Eric Sunshine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).