Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2007-07-26 03:57:33 +0000
committerSimon Kaegi2007-07-26 03:57:33 +0000
commitb5f0170f9de67addffbd0d8a932a6bf0042dae82 (patch)
tree946de05217d22f4f496fc620ce72f183c9cfe27b /bundles/org.eclipse.equinox.servletbridge/src
parent3f7656079a3b5729e00b8d6f050797705d037b90 (diff)
downloadrt.equinox.bundles-b5f0170f9de67addffbd0d8a932a6bf0042dae82.tar.gz
rt.equinox.bundles-b5f0170f9de67addffbd0d8a932a6bf0042dae82.tar.xz
rt.equinox.bundles-b5f0170f9de67addffbd0d8a932a6bf0042dae82.zip
Bug 197013 - [server] console command line parsing problem in FrameworkLauncher
Diffstat (limited to 'bundles/org.eclipse.equinox.servletbridge/src')
-rw-r--r--bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/FrameworkLauncher.java30
1 files changed, 22 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/FrameworkLauncher.java b/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/FrameworkLauncher.java
index 0035c7642..2c4b32a62 100644
--- a/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/FrameworkLauncher.java
+++ b/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/FrameworkLauncher.java
@@ -403,15 +403,29 @@ public class FrameworkLauncher {
while (tokenizer.hasMoreTokens()) {
String arg = tokenizer.nextToken();
if (arg.startsWith("\"")) { //$NON-NLS-1$
- String remainingArg = tokenizer.nextToken("\""); //$NON-NLS-1$
- arg = arg.substring(1) + remainingArg;
- // skip to next whitespace separated token
- tokenizer.nextToken(WS_DELIM);
+ if (arg.endsWith("\"")) { //$NON-NLS-1$
+ if (arg.length() >= 2) {
+ // strip the beginning and ending quotes
+ arg = arg.substring(1, arg.length() - 1);
+ }
+ } else {
+ String remainingArg = tokenizer.nextToken("\""); //$NON-NLS-1$
+ arg = arg.substring(1) + remainingArg;
+ // skip to next whitespace separated token
+ tokenizer.nextToken(WS_DELIM);
+ }
} else if (arg.startsWith("'")) { //$NON-NLS-1$
- String remainingArg = tokenizer.nextToken("'"); //$NON-NLS-1$
- arg = arg.substring(1) + remainingArg;
- // skip to next whitespace separated token
- tokenizer.nextToken(WS_DELIM);
+ if (arg.endsWith("'")) { //$NON-NLS-1$
+ if (arg.length() >= 2) {
+ // strip the beginning and ending quotes
+ arg = arg.substring(1, arg.length() - 1);
+ }
+ } else {
+ String remainingArg = tokenizer.nextToken("'"); //$NON-NLS-1$
+ arg = arg.substring(1) + remainingArg;
+ // skip to next whitespace separated token
+ tokenizer.nextToken(WS_DELIM);
+ }
}
args.add(arg);
}

Back to the top