From 1f6418427b280f5e56f33a8e21da6b9cc58ff9b0 Mon Sep 17 00:00:00 2001 From: Antoine Levy-Lambert Date: Tue, 23 Sep 2003 22:42:23 +0000 Subject: [PATCH] remove the -lib argument in Launcher if this is the last argument, since Main does not know what to do with it PR: 23358 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275326 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/launch/Launcher.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/org/apache/tools/ant/launch/Launcher.java b/src/main/org/apache/tools/ant/launch/Launcher.java index bbeeb9494..fb83a72b2 100644 --- a/src/main/org/apache/tools/ant/launch/Launcher.java +++ b/src/main/org/apache/tools/ant/launch/Launcher.java @@ -127,10 +127,16 @@ public class Launcher { break; } } - if (libPath.equals("")) { + if (args.length > 0 && args[args.length -1].equals("-lib")) { + // if the last argument is -lib + // remove it from the arguments passed to Launcher + // + newargs = new String[args.length - 1]; + System.arraycopy(args, 0, newargs, 0, args.length -1); + } else if (libPath.equals("")) { newargs = new String[args.length]; System.arraycopy(args, 0, newargs, 0, args.length); - } else { + } else { newargs = new String[args.length - 2]; // copy the beginning of the args array if (argcount > 0 ) {