diff --git a/frontends/amiga/arexx.c b/frontends/amiga/arexx.c index ef9ea537c..03ee8c489 100644 --- a/frontends/amiga/arexx.c +++ b/frontends/amiga/arexx.c @@ -68,6 +68,7 @@ enum RX_HOTLIST }; +Object *arexx_obj = NULL; STATIC char result[100]; STATIC VOID rx_open(struct ARexxCmd *, struct RexxMsg *); @@ -141,6 +142,12 @@ void ami_arexx_handle(void) RA_HandleRexx(arexx_obj); } +void ami_arexx_command(const char *cmd) +{ + if(arexx_obj == NULL) return; + IDoMethod(arexx_obj, AM_EXECUTE, cmd, NULL, NULL, NULL, NULL, NULL); +} + void ami_arexx_execute(char *script) { char full_script_path[1025]; @@ -149,7 +156,7 @@ void ami_arexx_execute(char *script) if((lock = Lock(script, ACCESS_READ))) { DevNameFromLock(lock, full_script_path, 1024, DN_FULLPATH); LOG("Executing script: %s", full_script_path); - IDoMethod(arexx_obj, AM_EXECUTE, full_script_path, NULL, NULL, NULL, NULL, NULL); + ami_arexx_command(full_script_path); UnLock(lock); } } diff --git a/frontends/amiga/arexx.h b/frontends/amiga/arexx.h index 358d174f3..198205388 100755 --- a/frontends/amiga/arexx.h +++ b/frontends/amiga/arexx.h @@ -25,8 +25,8 @@ BOOL ami_arexx_init(void); void ami_arexx_handle(void); void ami_arexx_execute(char *); +void ami_arexx_command(const char *cmd); void ami_arexx_cleanup(void); -Object *arexx_obj; ULONG rxsig; #endif diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index e41b4f05d..36447512f 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -1055,16 +1055,13 @@ static void gui_init2(int argc, char** argv) { STRPTR sendcmd = NULL; - if(temp_homepage_url) - { + if(temp_homepage_url) { sendcmd = ASPrintf("OPEN \"%s\" NEW",temp_homepage_url); free(temp_homepage_url); - } - else - { + } else { sendcmd = ASPrintf("OPEN \"%s\" NEW",nsoption_charp(homepage_url)); } - IDoMethod(arexx_obj,AM_EXECUTE,sendcmd,"NETSURF",NULL,NULL,NULL,NULL); + ami_arexx_command(sendcmd); FreeVec(sendcmd); ami_quit=true;