From a4fe48870ec95e83e7b0e7a981ecc4c860bad285 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Wed, 10 Feb 2010 07:51:20 +0000 Subject: [PATCH] 298615: Fix detection of space as separator in cygpath. --- .../utils/org/eclipse/cdt/utils/CygPath.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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 5d42ca07742..bb7d3a5d09e 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 @@ -41,18 +41,15 @@ public class CygPath { stdin = new BufferedWriter(new OutputStreamWriter(cygpath.getOutputStream())); stdout = new BufferedReader(new InputStreamReader(cygpath.getInputStream())); try { - getFileName("test"); //$NON-NLS-1$ // test for older cygpath - - // Bug 298615: Test for versions that tread space as a separator - getFileName("a b"); //$NON-NLS-1$ - if (stdout.ready()) { + String test= getFileName("a b"); //$NON-NLS-1$ + if ("a".equals(test)) { //$NON-NLS-1$ + // Bug 298615: This version seems to treat space as a separator fSpaceIsSeparator= true; - // Read off everything - while(stdout.ready()) { - stdout.read(); - } + // Read off second part + stdout.readLine(); } } catch (IOException e) { + // older cygwin dispose(); useOldCygPath = true; }