Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2018-08-16 05:06:08 -0400
committerLars Vogel2018-08-16 06:12:51 -0400
commit754910f570b70fe6055082f00b0e3595677db27c (patch)
tree00ab860a9f69d5f8eed45e0d276b2e6fbb91bfd0
parent154cff5fcc463304350172e8655bc729c317df8e (diff)
downloadeclipse.platform.team-754910f570b70fe6055082f00b0e3595677db27c.tar.gz
eclipse.platform.team-754910f570b70fe6055082f00b0e3595677db27c.tar.xz
eclipse.platform.team-754910f570b70fe6055082f00b0e3595677db27c.zip
lr.ignoreSingleCR(); must be always applied. Change-Id: I4c51abebcf65ebdc36fa3492c92fa2329c6a0cf1 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java1
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/LineReader.java12
3 files changed, 5 insertions, 10 deletions
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java
index b4e98370d..7cf392b75 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java
@@ -53,6 +53,7 @@ public class LineReader {
public static List<String> readLines(BufferedReader reader) {
List<String> lines;
LineReader lr= new LineReader(reader);
+ lr.ignoreSingleCR(); // Don't treat single CRs as line feeds to be consistent with command line patch
lines= lr.readLines();
return lines;
}
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java
index c56b99ff4..a9021afd4 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/PatchReader.java
@@ -89,7 +89,7 @@ public class PatchReader {
this.fIsGitPatch = false;
LineReader lr= new LineReader(reader);
-
+ lr.ignoreSingleCR(); // Don't treat single CRs as line feeds to be consistent with command line patch
// Test for our format
line= lr.readLine();
if (line != null && line.startsWith(PatchReader.MULTIPROJECTPATCH_HEADER)) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/LineReader.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/LineReader.java
index 9784601e1..8d0432e46 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/LineReader.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/LineReader.java
@@ -11,15 +11,8 @@
*******************************************************************************/
package org.eclipse.compare.internal.patch;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
+import java.io.*;
+import java.util.*;
import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.core.resources.IFile;
@@ -79,6 +72,7 @@ public class LineReader {
public static List<String> readLines(BufferedReader reader) {
List<String> lines;
LineReader lr = new LineReader(reader);
+ lr.ignoreSingleCR(); // Don't treat single CRs as line feeds to be consistent with command line patch
lines = lr.readLines();
return lines;
}

Back to the top