git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karthik Nayak <karthik.188@gmail.com>
To: git@vger.kernel.org
Cc: Karthik Nayak <karthik.188@gmail.com>
Subject: [PATCH] commit.c: Replace starts_with() with skip_prefix()
Date: Mon,  3 Mar 2014 13:17:55 +0530	[thread overview]
Message-ID: <1393832875-29096-1-git-send-email-karthik.188@gmail.com> (raw)

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

             reply	other threads:[~2014-03-03  7:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03  7:47 Karthik Nayak [this message]
2014-03-03  8:52 ` [PATCH] commit.c: Replace starts_with() with skip_prefix() Eric Sunshine
2014-03-03 15:23   ` karthik nayak
2014-03-03 23:54     ` Eric Sunshine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393832875-29096-1-git-send-email-karthik.188@gmail.com \
    --to=karthik.188@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).