Git development
 help / color / mirror / Atom feed
From: Jim Meyering <jim@meyering.net>
To: git list <git@vger.kernel.org>
Subject: [PATCH] xdiff-interface.c: remove 10 duplicated lines
Date: Wed, 26 Nov 2008 14:27:10 +0100	[thread overview]
Message-ID: <87vduazkgh.fsf@rho.meyering.net> (raw)


Remove an accidentally duplicated sequence of 10 lines.
This happens to plug a leak, too.

---
This is relative to the tip of "next".

 xdiff-interface.c |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/xdiff-interface.c b/xdiff-interface.c
index e8ef46d..d782f06 100644
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
@@ -247,30 +247,20 @@ static long ff_regexp(const char *line, long len,
 	/* Exclude terminating newline (and cr) from matching */
 	if (len > 0 && line[len-1] == '\n') {
 		if (len > 1 && line[len-2] == '\r')
 			len -= 2;
 		else
 			len--;
 	}

 	line_buffer = xstrndup(line, len); /* make NUL terminated */

-	/* Exclude terminating newline (and cr) from matching */
-	if (len > 0 && line[len-1] == '\n') {
-		if (len > 1 && line[len-2] == '\r')
-			len -= 2;
-		else
-			len--;
-	}
-
-	line_buffer = xstrndup(line, len); /* make NUL terminated */
-
 	for (i = 0; i < regs->nr; i++) {
 		struct ff_reg *reg = regs->array + i;
 		if (!regexec(&reg->re, line_buffer, 2, pmatch, 0)) {
 			if (reg->negate)
 				goto fail;
 			break;
 		}
 	}
 	if (regs->nr <= i)
 		goto fail;
@@ -331,11 +321,10 @@ int git_xmerge_config(const char *var, const char *value, void *cb)
 			git_xmerge_style = XDL_MERGE_DIFF3;
 		else if (!strcmp(value, "merge"))
 			git_xmerge_style = 0;
 		else
 			die("unknown style '%s' given for '%s'",
 			    value, var);
 		return 0;
 	}
 	return git_default_config(var, value, cb);
 }
-
--
1.6.0.4.1044.g77718

                 reply	other threads:[~2008-11-26 13:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87vduazkgh.fsf@rho.meyering.net \
    --to=jim@meyering.net \
    --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