Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/746177ee39482cfa7ea2e2fe66efd383a16b5379
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/746177ee39482cfa7ea2e2fe66efd383a16b5379
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/746177ee39482cfa7ea2e2fe66efd383a16b5379

The branch, master has been updated
       via  746177ee39482cfa7ea2e2fe66efd383a16b5379 (commit)
       via  b2e8c0d54ff9774585416fbea7c5c0b66909c535 (commit)
       via  7b28db62498e5b71c490000535c7e088605c0141 (commit)
      from  180295936b686d194b7b4c25b9a0dc2038ffc4cb (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=746177ee39482cfa7ea2e2fe66efd383a16b5379
commit 746177ee39482cfa7ea2e2fe66efd383a16b5379
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    stop monkey frontend using depricated warn_user API

diff --git a/monkey/browser.c b/monkey/browser.c
index 85b3c62..0b850d9 100644
--- a/monkey/browser.c
+++ b/monkey/browser.c
@@ -37,6 +37,13 @@ static uint32_t win_ctr = 0;
 
 static struct gui_window *gw_ring = NULL;
 
+/* exported function documented in monkey/browser.h */
+nserror monkey_warn_user(const char *warning, const char *detail)
+{
+  fprintf(stderr, "WARN %s %s\n", warning, detail);
+  return NSERROR_OK;
+}
+
 struct gui_window *
 monkey_find_window_by_num(uint32_t win_num)
 {
@@ -366,6 +373,9 @@ static void
 monkey_window_handle_go(int argc, char **argv)
 {
   struct gui_window *gw;
+  nsurl *url;
+  nsurl *ref_url = NULL;
+  nserror error;
   
   if (argc < 4 || argc > 5) {
     fprintf(stdout, "ERROR WINDOW GO ARGS BAD\n");
@@ -376,31 +386,32 @@ monkey_window_handle_go(int argc, char **argv)
   
   if (gw == NULL) {
     fprintf(stdout, "ERROR WINDOW NUM BAD\n");
-  } else {
-    nsurl *url;
-    nsurl *ref_url = NULL;
-    nserror error;
-
-    error = nsurl_create(argv[3], &url);
-    if (error != NSERROR_OK) {
-      warn_user(messages_get_errorcode(error), 0);
-    } else {
-      if (argc == 5) {
-       error = nsurl_create(argv[4], &ref_url);
-      }
+    return;
+  }
 
-      browser_window_navigate(gw->bw,
-                             url,
-                             ref_url,
-                             BW_NAVIGATE_HISTORY,
-                             NULL,
-                             NULL,
-                             NULL);
-      nsurl_unref(url);
+  error = nsurl_create(argv[3], &url);
+  if (error == NSERROR_OK) {
+    if (argc == 5) {
+      error = nsurl_create(argv[4], &ref_url);
+    }
+
+    if (error == NSERROR_OK) {
+      error = browser_window_navigate(gw->bw,
+                                     url,
+                                     ref_url,
+                                     BW_NAVIGATE_HISTORY,
+                                     NULL,
+                                     NULL,
+                                     NULL);
       if (ref_url != NULL) {
        nsurl_unref(ref_url);
       }
     }
+    nsurl_unref(url);
+  }
+
+  if (error != NSERROR_OK) {
+    monkey_warn_user(messages_get_errorcode(error), 0);
   }
 }
 
diff --git a/monkey/browser.h b/monkey/browser.h
index 7fe7c53..3257274 100644
--- a/monkey/browser.h
+++ b/monkey/browser.h
@@ -43,4 +43,6 @@ void monkey_window_process_reformats(void);
 void monkey_window_handle_command(int argc, char **argv);
 void monkey_kill_browser_windows(void);
 
+nserror monkey_warn_user(const char *warning, const char *detail);
+
 #endif /* NETSURF_MONKEY_BROWSER_H */
diff --git a/monkey/main.c b/monkey/main.c
index 7b38a38..ff70bda 100644
--- a/monkey/main.c
+++ b/monkey/main.c
@@ -223,12 +223,6 @@ static nserror set_defaults(struct nsoption_s *defaults)
   return NSERROR_OK;
 }
 
-static nserror monkey_warn_user(const char *warning, const char *detail)
-{
-  fprintf(stderr, "WARN %s %s\n", warning, detail);
-  return NSERROR_OK;
-}
-
 
 /**
  * Ensures output logging stream is correctly configured


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=b2e8c0d54ff9774585416fbea7c5c0b66909c535
commit b2e8c0d54ff9774585416fbea7c5c0b66909c535
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    stop teh png image content handler directly reporting errors to users

diff --git a/image/png.c b/image/png.c
index 1c78d30..11903cb 100644
--- a/image/png.c
+++ b/image/png.c
@@ -246,7 +246,6 @@ static nserror nspng_create_png_data(nspng_content *png_c)
        if (png_c->png == NULL) {
                msg_data.error = messages_get("NoMemory");
                content_broadcast(&png_c->base, CONTENT_MSG_ERROR, msg_data);
-               warn_user("NoMemory", 0);
                return NSERROR_NOMEM;
        }
 
@@ -258,7 +257,6 @@ static nserror nspng_create_png_data(nspng_content *png_c)
 
                msg_data.error = messages_get("NoMemory");
                content_broadcast(&png_c->base, CONTENT_MSG_ERROR, msg_data);
-               warn_user("NoMemory", 0);
                return NSERROR_NOMEM;
        }
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=7b28db62498e5b71c490000535c7e088605c0141
commit 7b28db62498e5b71c490000535c7e088605c0141
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    message get API should not raise user errors itself

diff --git a/utils/messages.c b/utils/messages.c
index d343cfc..e69a855 100644
--- a/utils/messages.c
+++ b/utils/messages.c
@@ -285,10 +285,7 @@ char *messages_get_buff(const char *key, ...)
 
        buff = malloc(buff_len + 1);
 
-       if (buff == NULL) {
-               LOG("malloc failed");
-               warn_user("NoMemory", 0);
-       } else {
+       if (buff != NULL) {
                va_start(ap, key);
                vsnprintf(buff, buff_len + 1, msg_fmt, ap);
                va_end(ap);


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

Summary of changes:
 image/png.c      |    2 --
 monkey/browser.c |   51 +++++++++++++++++++++++++++++++--------------------
 monkey/browser.h |    2 ++
 monkey/main.c    |    6 ------
 utils/messages.c |    5 +----
 5 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/image/png.c b/image/png.c
index 1c78d30..11903cb 100644
--- a/image/png.c
+++ b/image/png.c
@@ -246,7 +246,6 @@ static nserror nspng_create_png_data(nspng_content *png_c)
        if (png_c->png == NULL) {
                msg_data.error = messages_get("NoMemory");
                content_broadcast(&png_c->base, CONTENT_MSG_ERROR, msg_data);
-               warn_user("NoMemory", 0);
                return NSERROR_NOMEM;
        }
 
@@ -258,7 +257,6 @@ static nserror nspng_create_png_data(nspng_content *png_c)
 
                msg_data.error = messages_get("NoMemory");
                content_broadcast(&png_c->base, CONTENT_MSG_ERROR, msg_data);
-               warn_user("NoMemory", 0);
                return NSERROR_NOMEM;
        }
 
diff --git a/monkey/browser.c b/monkey/browser.c
index 85b3c62..0b850d9 100644
--- a/monkey/browser.c
+++ b/monkey/browser.c
@@ -37,6 +37,13 @@ static uint32_t win_ctr = 0;
 
 static struct gui_window *gw_ring = NULL;
 
+/* exported function documented in monkey/browser.h */
+nserror monkey_warn_user(const char *warning, const char *detail)
+{
+  fprintf(stderr, "WARN %s %s\n", warning, detail);
+  return NSERROR_OK;
+}
+
 struct gui_window *
 monkey_find_window_by_num(uint32_t win_num)
 {
@@ -366,6 +373,9 @@ static void
 monkey_window_handle_go(int argc, char **argv)
 {
   struct gui_window *gw;
+  nsurl *url;
+  nsurl *ref_url = NULL;
+  nserror error;
   
   if (argc < 4 || argc > 5) {
     fprintf(stdout, "ERROR WINDOW GO ARGS BAD\n");
@@ -376,31 +386,32 @@ monkey_window_handle_go(int argc, char **argv)
   
   if (gw == NULL) {
     fprintf(stdout, "ERROR WINDOW NUM BAD\n");
-  } else {
-    nsurl *url;
-    nsurl *ref_url = NULL;
-    nserror error;
-
-    error = nsurl_create(argv[3], &url);
-    if (error != NSERROR_OK) {
-      warn_user(messages_get_errorcode(error), 0);
-    } else {
-      if (argc == 5) {
-       error = nsurl_create(argv[4], &ref_url);
-      }
+    return;
+  }
 
-      browser_window_navigate(gw->bw,
-                             url,
-                             ref_url,
-                             BW_NAVIGATE_HISTORY,
-                             NULL,
-                             NULL,
-                             NULL);
-      nsurl_unref(url);
+  error = nsurl_create(argv[3], &url);
+  if (error == NSERROR_OK) {
+    if (argc == 5) {
+      error = nsurl_create(argv[4], &ref_url);
+    }
+
+    if (error == NSERROR_OK) {
+      error = browser_window_navigate(gw->bw,
+                                     url,
+                                     ref_url,
+                                     BW_NAVIGATE_HISTORY,
+                                     NULL,
+                                     NULL,
+                                     NULL);
       if (ref_url != NULL) {
        nsurl_unref(ref_url);
       }
     }
+    nsurl_unref(url);
+  }
+
+  if (error != NSERROR_OK) {
+    monkey_warn_user(messages_get_errorcode(error), 0);
   }
 }
 
diff --git a/monkey/browser.h b/monkey/browser.h
index 7fe7c53..3257274 100644
--- a/monkey/browser.h
+++ b/monkey/browser.h
@@ -43,4 +43,6 @@ void monkey_window_process_reformats(void);
 void monkey_window_handle_command(int argc, char **argv);
 void monkey_kill_browser_windows(void);
 
+nserror monkey_warn_user(const char *warning, const char *detail);
+
 #endif /* NETSURF_MONKEY_BROWSER_H */
diff --git a/monkey/main.c b/monkey/main.c
index 7b38a38..ff70bda 100644
--- a/monkey/main.c
+++ b/monkey/main.c
@@ -223,12 +223,6 @@ static nserror set_defaults(struct nsoption_s *defaults)
   return NSERROR_OK;
 }
 
-static nserror monkey_warn_user(const char *warning, const char *detail)
-{
-  fprintf(stderr, "WARN %s %s\n", warning, detail);
-  return NSERROR_OK;
-}
-
 
 /**
  * Ensures output logging stream is correctly configured
diff --git a/utils/messages.c b/utils/messages.c
index d343cfc..e69a855 100644
--- a/utils/messages.c
+++ b/utils/messages.c
@@ -285,10 +285,7 @@ char *messages_get_buff(const char *key, ...)
 
        buff = malloc(buff_len + 1);
 
-       if (buff == NULL) {
-               LOG("malloc failed");
-               warn_user("NoMemory", 0);
-       } else {
+       if (buff != NULL) {
                va_start(ap, key);
                vsnprintf(buff, buff_len + 1, msg_fmt, ap);
                va_end(ap);


-- 
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