diff options
author | Darin Swanson | 2007-02-23 15:24:50 +0000 |
---|---|---|
committer | Darin Swanson | 2007-02-23 15:24:50 +0000 |
commit | 8e8508d9d25e2f02d90c9245b341854bd52f810f (patch) | |
tree | 0057bb13ed2026db196836f5742c6609cc61cef8 /org.eclipse.ui.externaltools | |
parent | 45685c3802b1de37da0e0b18897dd7a645351ed1 (diff) | |
download | eclipse.platform.debug-8e8508d9d25e2f02d90c9245b341854bd52f810f.tar.gz eclipse.platform.debug-8e8508d9d25e2f02d90c9245b341854bd52f810f.tar.xz eclipse.platform.debug-8e8508d9d25e2f02d90c9245b341854bd52f810f.zip |
Bug 138007 - system_path macro should support common extensions in Windows
Diffstat (limited to 'org.eclipse.ui.externaltools')
-rw-r--r-- | org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/SystemPathResolver.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/SystemPathResolver.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/SystemPathResolver.java index e282a56d1..ddc8903e0 100644 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/SystemPathResolver.java +++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/SystemPathResolver.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. + * Copyright (c) 2005, 2007 IBM Corporation 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: * IBM Corporation - initial API and implementation + * Wieant (wieant@tasking.com) - Bug 138007 *******************************************************************************/ package org.eclipse.ui.externaltools.internal.variables; @@ -36,6 +37,9 @@ public class SystemPathResolver implements IDynamicVariableResolver { if (path == null) { return argument; } + // On MS Windows the PATHEXT environment variable defines which file extensions + // mark files that are executable (e.g. .EXE, .COM, .BAT) + String pathext = (String) map.get("PATHEXT"); //$NON-NLS-1$ StringTokenizer tokenizer= new StringTokenizer(path, File.pathSeparator); while (tokenizer.hasMoreTokens()) { String pathElement= tokenizer.nextToken(); @@ -45,8 +49,18 @@ public class SystemPathResolver implements IDynamicVariableResolver { if (toolFile.exists()) { return toolFile.getAbsolutePath(); } + if ( pathext != null ) { + StringTokenizer pathextTokenizer = new StringTokenizer(pathext, File.pathSeparator); + while (pathextTokenizer.hasMoreTokens()) { + String pathextElement = pathextTokenizer.nextToken(); + toolFile = new File(pathElementFile, argument + pathextElement); + if (toolFile.exists()) { + return toolFile.getAbsolutePath(); + } + } + } } } - return argument; + return argument; } } |