summaryrefslogtreecommitdiff
path: root/frontends/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2016-09-10 18:37:18 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2016-09-10 18:37:18 +0100
commit7cbff32f92596119896582925978016e9d672f58 (patch)
tree0f459c240b723ba1416c5cdf74f6b74412635004 /frontends/amiga
parente34b783b8d22194873b8493fc75a4b93723c4b4b (diff)
downloadnetsurf-7cbff32f92596119896582925978016e9d672f58.tar.gz
netsurf-7cbff32f92596119896582925978016e9d672f58.tar.bz2
Stop passing NSOPTS/M back to the core
This is a quick fix to stop NetSurf crashing when the URL is provided on the commandline without the URL keyword. Passing options on the commandline will not work until this is fixed properly.
Diffstat (limited to 'frontends/amiga')
-rw-r--r--frontends/amiga/gui.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 9e5850a85..9aaf182ee 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -849,7 +849,6 @@ static void ami_openscreenfirst(void)
static struct RDArgs *ami_gui_commandline(int *restrict argc, char ** argv,
int *restrict nargc, char ** nargv)
{
- int new_argc = 1;
struct RDArgs *args;
CONST_STRPTR template = "-v/S,NSOPTS/M,URL/K,USERSDIR/K,FORCE/S";
long rarray[] = {0,0,0,0,0};
@@ -892,32 +891,17 @@ static struct RDArgs *ami_gui_commandline(int *restrict argc, char ** argv,
* first, nsoption_commandline() can no longer parse (fetch?)
* the arguments. If nsoption_commandline() is called first,
* then ReadArgs cannot fetch the arguments.
+ *\todo this was totally broken so to stop startup crashing
+ * has been temporarily removed (core cli not called when func
+ * returns NULL).
*/
- char **p = (char **)rarray[A_NSOPTS];
-
- do {
- LOG("Arg [%d] assigned to NSOPTS/M by ReadArgs: %s", new_argc, *p);
- new_argc++;
- p++;
- } while(*p != NULL);
-
- const char *new_argv = malloc(sizeof(char *) * new_argc);
- const char **new_argvp = &new_argv;
- p = (char **)rarray[A_NSOPTS];
-
- do {
- *new_argvp = *p;
- new_argvp++;
- p++;
- } while(*p != NULL);
-
- *nargc = new_argc;
- *nargv = new_argv;
}
} else {
LOG("ReadArgs failed to parse command line");
}
- return args;
+
+ FreeArgs(args);
+ return NULL;
}
static void ami_gui_read_tooltypes(struct WBArg *wbarg)