Don't re-parse arguments to --preferences-file

Previously, the argument to --preferences-file would be interpreted as a
filename, but then also checked as an option as well (in the next loop
iteration). This didn't really matter in practice (unless you would be
using a file called "--preferences-file"), but better skip the argument
anyway.
This commit is contained in:
Matthijs Kooijman 2014-04-08 12:07:20 +02:00 committed by Cristian Maglie
parent 9e17e52f63
commit cf4fb7d0e3
1 changed files with 4 additions and 2 deletions

View File

@ -147,8 +147,10 @@ public class Base {
// when no parameter was specified to an option. Later, Base() will
// then show an error for these.
for (int i = 0; i < args.length - 1; i++) {
if (args[i].equals("--preferences-file"))
preferencesFile = new File(args[i + 1]);
if (args[i].equals("--preferences-file")) {
++i;
preferencesFile = new File(args[i]);
}
}
// run static initialization that grabs all the prefs