Skip to content

Commit

Permalink
do not pass on Output() if we have been started from workbench so we …
Browse files Browse the repository at this point in the history
…avoid a CONSOLE: window being opened
  • Loading branch information
gooofy committed Oct 16, 2021
1 parent 78fa575 commit b60a095
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/compiler/aqb.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ extern struct DOSBase *DOSBase;
char aqb_home[PATH_MAX];
char aqb_lib[PATH_MAX];
char aqb_help[PATH_MAX];
bool aqb_wbstart = FALSE;

static void print_usage(char *argv[])
{
Expand Down Expand Up @@ -329,6 +330,7 @@ int main (int argc, char *argv[])
#ifdef __amigaos__
if (argc == 0) // workbench launch
{
aqb_wbstart = TRUE;
struct WBStartup *wb_msg = (struct WBStartup *) argv;
struct WBArg *wbarg = wb_msg->sm_ArgList;
for (uint16_t i=0; i < wb_msg->sm_NumArgs; i++, wbarg++)
Expand Down
1 change: 1 addition & 0 deletions src/compiler/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
extern char aqb_home[PATH_MAX];
extern char aqb_lib[PATH_MAX];
extern char aqb_help[PATH_MAX];
extern bool aqb_wbstart;

/*
* compiler options
Expand Down
3 changes: 2 additions & 1 deletion src/compiler/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "run.h"
#include "logger.h"
#include "ui.h"
#include "options.h"

static RUN_state g_debugState = RUN_stateStopped;

Expand Down Expand Up @@ -94,7 +95,7 @@ static void _launch_process (RUN_env env, char *binfn, char *arg1, bool dbg)
env->childProc = CreateNewProcTags(NP_Seglist, (ULONG) env->seglist,
NP_FreeSeglist, FALSE,
NP_Input, 0l,
NP_Output, Output(),
NP_Output, aqb_wbstart ? 0 : Output(),
NP_CloseInput, FALSE,
NP_CloseOutput, FALSE,
NP_StackSize, DEFAULT_STACKSIZE,
Expand Down

0 comments on commit b60a095

Please sign in to comment.