From d81756f82e3d87dc07354cd953a67a55e2fd2bc1 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Thu, 4 Feb 2010 12:21:43 +0000 Subject: [PATCH] Bug 301706: Mac OS: Debugger can not handle file paths with spaces. --- .../command/factories/macos/MacOSMIEnvironmentCD.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/macos/MacOSMIEnvironmentCD.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/macos/MacOSMIEnvironmentCD.java index b9905acb40b..36c1ff61a3e 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/macos/MacOSMIEnvironmentCD.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/macos/MacOSMIEnvironmentCD.java @@ -1,5 +1,5 @@ /********************************************************************** - * Copyright (c) 2006 Nokia and others. + * Copyright (c) 2006, 2010 Nokia and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * Nokia - Initial API and implementation + * Marc-Andre Laperle - fix for bug 263689 (spaces in directory) ***********************************************************************/ package org.eclipse.cdt.debug.mi.core.command.factories.macos; @@ -16,13 +17,15 @@ public class MacOSMIEnvironmentCD extends MIEnvironmentCD { public MacOSMIEnvironmentCD(String miVersion, String path) { super(miVersion, path); - this.setOperation("cd");//$NON-NLS-1$ + this.setOperation("-environment-cd");//$NON-NLS-1$ } protected String parametersToString() { String[] parameters = getParameters(); if (parameters != null && parameters.length == 1) { - return '"' + parameters[0] + '"'; + // To handle spaces in the path, the command string has this format: + // -environment-cd "\"/path with spaces\"" + return "\"\\\"" + parameters[0] + "\\\"\""; //$NON-NLS-1$ //$NON-NLS-2$ } return super.parametersToString(); }