diff options
author | Andre Weinand | 2003-02-12 14:51:08 +0000 |
---|---|---|
committer | Andre Weinand | 2003-02-12 14:51:08 +0000 |
commit | 0799b5a635fbd458c2ad1c02f715db6e6e4987b9 (patch) | |
tree | c39cbb11f107505de3917640721c5973719537c8 | |
parent | a1143816353ec2ec150b67e883f2180074012977 (diff) | |
download | eclipse.platform.team-0799b5a635fbd458c2ad1c02f715db6e6e4987b9.tar.gz eclipse.platform.team-0799b5a635fbd458c2ad1c02f715db6e6e4987b9.tar.xz eclipse.platform.team-0799b5a635fbd458c2ad1c02f715db6e6e4987b9.zip |
fixed #31633
2 files changed, 16 insertions, 34 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java index 7dcf32692..df3ba5c4e 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java @@ -4,6 +4,8 @@ import java.io.*; import java.text.*; import java.util.*; +import org.eclipse.swt.SWT; + import org.eclipse.jface.util.Assert; import org.eclipse.core.runtime.*; @@ -142,7 +144,8 @@ public class Patcher { String fileName= null; LineReader lr= new LineReader(reader); - lr.ignoreSingleCR(); + if (!"carbon".equals(SWT.getPlatform())) //$NON-NLS-1$ + lr.ignoreSingleCR(); // read leading garbage while (true) { @@ -592,21 +595,6 @@ public class Patcher { } /** - * Tries to patch the contents of the given reader with the specified Diff. - * Any hunk that couldn't be applied is returned in the list failedHunks. - */ - /* package */ String patch(Diff diff, BufferedReader reader, List failedHunks) { - - List lines= new LineReader(reader).readLines(); - if (lines == null) - lines= new ArrayList(); - - patch(diff, lines, failedHunks); - - return createString(lines); - } - - /** * Tries to apply the specified hunk to the given lines. * If the hunk cannot be applied at the original position * the methods tries Fuzz lines before and after. @@ -847,7 +835,10 @@ public class Patcher { } BufferedReader reader= new BufferedReader(streamReader); - lines= new LineReader(reader).readLines(); + LineReader lr= new LineReader(reader); + if (!"carbon".equals(SWT.getPlatform())) //$NON-NLS-1$ + lr.ignoreSingleCR(); + lines= lr.readLines(); } catch(CoreException ex) { } finally { if (is != null) diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java index 7dcf32692..df3ba5c4e 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java @@ -4,6 +4,8 @@ import java.io.*; import java.text.*; import java.util.*; +import org.eclipse.swt.SWT; + import org.eclipse.jface.util.Assert; import org.eclipse.core.runtime.*; @@ -142,7 +144,8 @@ public class Patcher { String fileName= null; LineReader lr= new LineReader(reader); - lr.ignoreSingleCR(); + if (!"carbon".equals(SWT.getPlatform())) //$NON-NLS-1$ + lr.ignoreSingleCR(); // read leading garbage while (true) { @@ -592,21 +595,6 @@ public class Patcher { } /** - * Tries to patch the contents of the given reader with the specified Diff. - * Any hunk that couldn't be applied is returned in the list failedHunks. - */ - /* package */ String patch(Diff diff, BufferedReader reader, List failedHunks) { - - List lines= new LineReader(reader).readLines(); - if (lines == null) - lines= new ArrayList(); - - patch(diff, lines, failedHunks); - - return createString(lines); - } - - /** * Tries to apply the specified hunk to the given lines. * If the hunk cannot be applied at the original position * the methods tries Fuzz lines before and after. @@ -847,7 +835,10 @@ public class Patcher { } BufferedReader reader= new BufferedReader(streamReader); - lines= new LineReader(reader).readLines(); + LineReader lr= new LineReader(reader); + if (!"carbon".equals(SWT.getPlatform())) //$NON-NLS-1$ + lr.ignoreSingleCR(); + lines= lr.readLines(); } catch(CoreException ex) { } finally { if (is != null) |