Browse Source

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
master
Antoine Levy-Lambert 21 years ago
parent
commit
1f6418427b
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      src/main/org/apache/tools/ant/launch/Launcher.java

+ 8
- 2
src/main/org/apache/tools/ant/launch/Launcher.java View File

@@ -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 ) {


Loading…
Cancel
Save