Skip to content

Commit cf4fb7d

Browse files
matthijskooijmancmaglie
authored andcommitted
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.
1 parent 9e17e52 commit cf4fb7d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/src/processing/app/Base.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ static public void main(String args[]) throws Exception {
147147
// when no parameter was specified to an option. Later, Base() will
148148
// then show an error for these.
149149
for (int i = 0; i < args.length - 1; i++) {
150-
if (args[i].equals("--preferences-file"))
151-
preferencesFile = new File(args[i + 1]);
150+
if (args[i].equals("--preferences-file")) {
151+
++i;
152+
preferencesFile = new File(args[i]);
153+
}
152154
}
153155

154156
// run static initialization that grabs all the prefs

0 commit comments

Comments
 (0)