Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/7cbff32f92596119896582925978016e9d672f58
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/7cbff32f92596119896582925978016e9d672f58
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/7cbff32f92596119896582925978016e9d672f58

The branch, master has been updated
       via  7cbff32f92596119896582925978016e9d672f58 (commit)
      from  e34b783b8d22194873b8493fc75a4b93723c4b4b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=7cbff32f92596119896582925978016e9d672f58
commit 7cbff32f92596119896582925978016e9d672f58
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    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.

diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 9e5850a..9aaf182 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)


-----------------------------------------------------------------------

Summary of changes:
 frontends/amiga/gui.c |   28 ++++++----------------------
 1 file changed, 6 insertions(+), 22 deletions(-)

diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 9e5850a..9aaf182 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)


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to