Skip to content

Commit 9b47787

Browse files
authored
Update dinterpreter.cpp: patch issue #1969
.run was exactly as .compile, although .run should 'run' the eventual $MAIN$ (I.e.: not defining a procedure/function) commands entered.
1 parent e7ccf8c commit 9b47787

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/dinterpreter.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -927,12 +927,11 @@ DInterpreter::CommandCode DInterpreter::CmdRun( const string& command)
927927
}
928928
}
929929

930-
// if( retAll)
931-
// Warning( "Compiled a main program while inside a procedure. "
932-
// "Returning.");
933-
930+
// GD see issue #1969: this is the only difference with CmdCompile: process the
931+
// eventual $MAIN$ commands that are at the end of 'argstr'.pro when CmdCompile
932+
// would just ignore these non-procedure commands.
934933
// actual run is perfomed in InterpreterLoop()
935-
if( retAll) RetAll( RetAllException::RUN); // throws (always)
934+
RetAll( RetAllException::RUN); // difference is here.
936935
return CC_OK; //avoid warnings
937936
}
938937

0 commit comments

Comments
 (0)