Skip to content

Commit cc5de9d

Browse files
eelstretchingjhalexand
authored andcommitted
If a default command was defined for an interpreter, the interpreter tries to run it as it is exiting, which may lead to exceptions (#11)
1 parent a4832f1 commit cc5de9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

olcut-core/src/main/java/com/oracle/labs/mlrg/olcut/command/CommandInterpreter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ private String execute(String[] args, boolean first) {
838838
ex.printStackTrace(out);
839839
}
840840
} else {
841-
if(first && defaultCommand != null) {
841+
if(first && defaultCommand != null && !command.equals("on_exit")) {
842842
String[] newArgs = new String[args.length + 1];
843843
newArgs[0] = defaultCommand;
844844
System.arraycopy(args, 0, newArgs, 1,

0 commit comments

Comments
 (0)