From 6ad26ed053056779f87fd332e2249ee4c8643abb Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Thu, 7 Jun 2007 19:24:16 +0000 Subject: [PATCH] Stop cygpath from being called on non-Windows platforms. --- .../utils/org/eclipse/cdt/utils/CygPath.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CygPath.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CygPath.java index e59d9bb8690..fe756cedf24 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CygPath.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CygPath.java @@ -19,6 +19,7 @@ import java.io.OutputStreamWriter; import org.eclipse.cdt.utils.spawner.ProcessFactory; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; public class CygPath { @@ -28,6 +29,9 @@ public class CygPath { private final BufferedWriter stdin; public CygPath(String command) throws IOException { + if (!Platform.getOS().equals(Platform.OS_WIN32)) + // Don't run this on non-windows platforms + throw new IOException("Not Windows"); //$NON-NLS-1$ String[] args = {command, "--windows", "--file", "-"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ cygpath = ProcessFactory.getFactory().exec(args); stdin = new BufferedWriter(new OutputStreamWriter(cygpath.getOutputStream()));