From 74108d1e09f42c61d48219edc578d04c8df9cd13 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 28 Mar 2010 16:42:33 +0000 Subject: Allow NetSurf to be opened from the CLI without a URL specified. Add new switch FORCE which will force a new instance of NetSurf to open rather than opening a new window in the already-running application (intended for debugging when NetSurf has crashed) svn path=/trunk/netsurf/; revision=10189 --- amiga/gui.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index 8d989c5c8..52484930e 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -549,15 +549,16 @@ void ami_openscreenfirst(void) void gui_init2(int argc, char** argv) { struct browser_window *bw = NULL; - long rarray[] = {0}; + long rarray[] = {0,0}; struct RDArgs *args; - STRPTR template = "URL/A"; + STRPTR template = "URL,FORCE/S"; STRPTR temp_homepage_url = NULL; BOOL notalreadyrunning; enum { - A_URL + A_URL, + A_FORCE }; notalreadyrunning = ami_arexx_init(); @@ -582,6 +583,12 @@ void gui_init2(int argc, char** argv) free(temp_homepage_url); } } + + if(rarray[A_FORCE]) + { + notalreadyrunning = TRUE; + } + FreeArgs(args); } } @@ -679,7 +686,7 @@ void gui_init2(int argc, char** argv) } GetApplicationAttrs(ami_appid, APPATTR_Port, (ULONG)&applibport, TAG_DONE); - applibsig = (1L << applibport->mp_SigBit); + if(applibport) applibsig = (1L << applibport->mp_SigBit); } if(!bw && (option_startup_no_window == false)) @@ -1627,6 +1634,8 @@ void ami_handle_applib(void) struct ApplicationMsg *applibmsg; struct browser_window *bw; + if(!applibport) return; + while((applibmsg=(struct ApplicationMsg *)GetMsg(applibport))) { switch (applibmsg->type) -- cgit v1.2.3