diff options
author | Markus Keller | 2012-09-05 15:59:51 +0000 |
---|---|---|
committer | Mike Rennie | 2012-09-05 15:59:51 +0000 |
commit | 37978528c6f546dbacda8aaa7c9b284e602b5b44 (patch) | |
tree | cee56b51c5b3edecff7ec849a07e50974cc6243b /org.eclipse.debug.ui | |
parent | 176d9f36b174c79199db39afe242047fc5d6290d (diff) | |
download | eclipse.platform.debug-37978528c6f546dbacda8aaa7c9b284e602b5b44.tar.gz eclipse.platform.debug-37978528c6f546dbacda8aaa7c9b284e602b5b44.tar.xz eclipse.platform.debug-37978528c6f546dbacda8aaa7c9b284e602b5b44.zip |
Bug 387504 - Bugs in program argument parsing (compared to command line)v20120905-155951
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java index 129b493ef..4e42fc0b6 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java @@ -93,33 +93,24 @@ public class ProcessPropertyPage extends PropertyPage { ((GridData)text.getLayoutData()).horizontalIndent = 10; String commandLineText = getCommandLineText(proc); if (commandLineText != null) { - final String[] arguments = DebugPlugin.parseArguments(commandLineText); - StringBuffer renderedCommandLine = new StringBuffer(commandLineText.length()); - for (int i = 0; i < arguments.length; i++) { - if (i > 0) - renderedCommandLine.append(' '); - renderedCommandLine.append(arguments[i]); - } - text.addSegmentListener(new SegmentListener() { - public void getSegments(SegmentEvent event) { - int count = arguments.length; - if (count < 2) - return; - - int[] segments = new int[count - 1]; - int nextStart = arguments[0].length() + 1; - for (int i = 1; i < count; i++) { - segments[i - 1] = nextStart; - nextStart = nextStart + arguments[i].length() + 1; + String[] arguments = DebugPlugin.parseArguments(commandLineText); + int count = arguments.length; + if (count > 1) { + // render as one argument per line, but don't copy line delimiters to clipboard: + final int[] segments = new int[count - 1]; + final char[] chars = new char[count - 1]; + Arrays.fill(chars, '\n'); + + commandLineText = DebugPlugin.renderArguments(arguments, segments); + + text.addSegmentListener(new SegmentListener() { + public void getSegments(SegmentEvent event) { + event.segments = segments; + event.segmentsChars = chars; } - event.segments = segments; - - char[] chars = new char[count - 1]; - Arrays.fill(chars, '\n'); - event.segmentsChars = chars; - } - }); - text.setText(renderedCommandLine.toString()); + }); + } + text.setText(commandLineText); } //create environment section |