[bugzilla-gnome-org-extensions] Fix a couple of minor bugs in hunk.getLocation()
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bugzilla-gnome-org-extensions] Fix a couple of minor bugs in hunk.getLocation()
- Date: Thu, 20 Nov 2014 22:23:29 +0000 (UTC)
commit a3c7a1fc056e40454ecd3aa6377a525d26244acd
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Sat Oct 10 17:43:04 2009 -0400
Fix a couple of minor bugs in hunk.getLocation()
Fix a confusion between oldStart and newStart, and add some
parentheses for clarity.
js/patch.js | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/js/patch.js b/js/patch.js
index cedb339..5803340 100644
--- a/js/patch.js
+++ b/js/patch.js
@@ -190,11 +190,11 @@ File.prototype = {
var hunk = this.hunks[i];
if (oldLine != null && hunk.oldStart > oldLine)
continue;
- if (newLine != null && hunk.oldStart > newLine)
+ if (newLine != null && hunk.newStart > newLine)
continue;
if ((oldLine != null && oldLine < hunk.oldStart + hunk.oldCount) ||
- newLine != null && newLine < hunk.newStart + hunk.newCount) {
+ (newLine != null && newLine < hunk.newStart + hunk.newCount)) {
var location = -1;
hunk.iterate(function(loc, oldl, oldText, newl, newText, flags) {
if ((oldLine == null || oldl == oldLine) &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]