Gitweb links:

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

The branch, master has been updated
       via  da7c750efdb215ed5c8c16dd071dee7544d034c9 (commit)
       via  699cc7deeebb2b148bbf32a2dd60098fdc6fd726 (commit)
       via  bb60859535e92f16adbd63b8bba9b0ba6b5fb4b1 (commit)
      from  d0359bc957235384074363eb04f673be7195cd9e (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=da7c750efdb215ed5c8c16dd071dee7544d034c9
commit da7c750efdb215ed5c8c16dd071dee7544d034c9
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    fix some formatting in save complete

diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index 7dc86c4..1ecb313 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -140,14 +140,16 @@ save_complete_ctx_find_content(save_complete_ctx *ctx, 
const nsurl *url)
 }
 
 
-static bool save_complete_ctx_has_content(save_complete_ctx *ctx,
-               struct hlcache_handle *content)
+static bool
+save_complete_ctx_has_content(save_complete_ctx *ctx,
+                             struct hlcache_handle *content)
 {
        save_complete_entry *entry;
 
-       for (entry = ctx->list; entry != NULL; entry = entry->next)
+       for (entry = ctx->list; entry != NULL; entry = entry->next) {
                if (entry->content == content)
                        return true;
+       }
 
        return false;
 }
@@ -409,8 +411,10 @@ save_complete_save_stylesheet(save_complete_ctx *ctx, 
hlcache_handle *css)
        return result;
 }
 
-static bool save_complete_save_imported_sheets(save_complete_ctx *ctx,
-               struct nscss_import *imports, uint32_t import_count)
+static bool
+save_complete_save_imported_sheets(save_complete_ctx *ctx,
+                                  struct nscss_import *imports,
+                                  uint32_t import_count)
 {
        uint32_t i;
 
@@ -425,8 +429,9 @@ static bool 
save_complete_save_imported_sheets(save_complete_ctx *ctx,
        return true;
 }
 
-static bool save_complete_save_html_stylesheet(save_complete_ctx *ctx,
-               struct html_stylesheet *sheet)
+static bool
+save_complete_save_html_stylesheet(save_complete_ctx *ctx,
+                                  struct html_stylesheet *sheet)
 {
        if (sheet->sheet == NULL)
                return true;
@@ -756,8 +761,10 @@ static bool 
save_complete_handle_attr_value(save_complete_ctx *ctx,
        }
 }
 
-static bool save_complete_handle_attr(save_complete_ctx *ctx,
-               dom_string *node_name, dom_attr *attr)
+static bool
+save_complete_handle_attr(save_complete_ctx *ctx,
+                         dom_string *node_name,
+                         dom_attr *attr)
 {
        dom_string *name;
        const char *name_data;
@@ -800,8 +807,10 @@ static bool save_complete_handle_attr(save_complete_ctx 
*ctx,
        return true;
 }
 
-static bool save_complete_handle_attrs(save_complete_ctx *ctx,
-               dom_string *node_name, dom_namednodemap *attrs)
+static bool
+save_complete_handle_attrs(save_complete_ctx *ctx,
+                          dom_string *node_name,
+                          dom_namednodemap *attrs)
 {
        uint32_t length, i;
        dom_exception error;
@@ -831,8 +840,10 @@ static bool save_complete_handle_attrs(save_complete_ctx 
*ctx,
        return true;
 }
 
-static bool save_complete_handle_element(save_complete_ctx *ctx,
-               dom_node *node, save_complete_event_type event_type)
+static bool
+save_complete_handle_element(save_complete_ctx *ctx,
+                            dom_node *node,
+                            save_complete_event_type event_type)
 {
        dom_string *name;
        dom_namednodemap *attrs;
@@ -853,12 +864,12 @@ static bool 
save_complete_handle_element(save_complete_ctx *ctx,
        name_data = dom_string_data(name);
        name_len = dom_string_byte_length(name);
 
-       if (name_len == SLEN("base") &&
-                       strncasecmp(name_data, "base", name_len) == 0) {
+       if ((name_len == SLEN("base")) &&
+           (strncasecmp(name_data, "base", name_len) == 0)) {
                /* Elide BASE elements from the output */
                process = false;
-       } else if (name_len == SLEN("meta") &&
-                       strncasecmp(name_data, "meta", name_len) == 0) {
+       } else if ((name_len == SLEN("meta")) &&
+                  (strncasecmp(name_data, "meta", name_len) == 0)) {
                /* Don't emit close tags for META elements */
                if (event_type == EVENT_LEAVE) {
                        process = false;
@@ -866,7 +877,8 @@ static bool save_complete_handle_element(save_complete_ctx 
*ctx,
                        /* Elide meta charsets */
                        dom_string *value;
                        error = dom_element_get_attribute(node,
-                                       corestring_dom_http_equiv, &value);
+                                                 corestring_dom_http_equiv,
+                                                 &value);
                        if (error != DOM_NO_ERR) {
                                dom_string_unref(name);
                                return false;
@@ -908,8 +920,9 @@ static bool save_complete_handle_element(save_complete_ctx 
*ctx,
        }
 
        fputc('<', ctx->fp);
-       if (event_type == EVENT_LEAVE)
+       if (event_type == EVENT_LEAVE) {
                fputc('/', ctx->fp);
+       }
        fwrite(name_data, sizeof(*name_data), name_len, ctx->fp);
 
        if (event_type == EVENT_ENTER) {
@@ -979,8 +992,10 @@ static bool save_complete_handle_element(save_complete_ctx 
*ctx,
        return true;
 }
 
-static bool save_complete_node_handler(dom_node *node,
-               save_complete_event_type event_type, void *ctxin)
+static bool
+save_complete_node_handler(dom_node *node,
+                          save_complete_event_type event_type,
+                          void *ctxin)
 {
        save_complete_ctx *ctx = ctxin;
        dom_node_type type;
@@ -1098,8 +1113,10 @@ static bool save_complete_node_handler(dom_node *node,
        return true;
 }
 
-static bool save_complete_save_html_document(save_complete_ctx *ctx,
-               hlcache_handle *c, bool index)
+static bool
+save_complete_save_html_document(save_complete_ctx *ctx,
+                                hlcache_handle *c,
+                                bool index)
 {
        nserror ret;
        FILE *fp;
@@ -1134,8 +1151,9 @@ static bool 
save_complete_save_html_document(save_complete_ctx *ctx,
 
        doc = html_get_document(c);
 
-       if (save_complete_libdom_treewalk((dom_node *) doc,
-                       save_complete_node_handler, ctx) == false) {
+       if (save_complete_libdom_treewalk((dom_node *)doc,
+                                         save_complete_node_handler,
+                                         ctx) == false) {
                free(fname);
                guit->misc->warning("NoMemory", 0);
                fclose(fp);
@@ -1164,8 +1182,10 @@ static bool 
save_complete_save_html_document(save_complete_ctx *ctx,
  * \param  index  true to save as "index"
  * \return  true on success, false on error and error reported
  */
-static bool save_complete_save_html(save_complete_ctx *ctx, hlcache_handle *c,
-               bool index)
+static bool
+save_complete_save_html(save_complete_ctx *ctx,
+                       hlcache_handle *c,
+                       bool index)
 {
        if (content_get_type(c) != CONTENT_HTML)
                return false;


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

    ensure save_complete resources are correctly finalised before quit

diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index 4d98d2e..7dc86c4 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -1272,6 +1272,13 @@ void save_complete_init(void)
 }
 
 /* Documented in save_complete.h */
+nserror save_complete_finalise(void)
+{
+       regfree(&save_complete_import_re);
+       return NSERROR_OK;
+}
+
+/* Documented in save_complete.h */
 bool
 save_complete(hlcache_handle *c,
              const char *path,
diff --git a/desktop/save_complete.h b/desktop/save_complete.h
index 3c389a5..f7f2507 100644
--- a/desktop/save_complete.h
+++ b/desktop/save_complete.h
@@ -44,6 +44,12 @@ typedef void (*save_complete_set_type_cb)(const char *path,
  */
 void save_complete_init(void);
 
+
+/**
+ * Finalise save complete module.
+ */
+nserror save_complete_finalise(void);
+
 /**
  * Save an HTML page with all dependencies.
  *
diff --git a/frontends/gtk/gui.c b/frontends/gtk/gui.c
index f14c7bd..ea8d77a 100644
--- a/frontends/gtk/gui.c
+++ b/frontends/gtk/gui.c
@@ -543,6 +543,12 @@ static void gui_quit(void)
                      messages_get_errorcode(res));
        }
 
+       res = save_complete_finalise();
+       if (res != NSERROR_OK) {
+               NSLOG(netsurf, INFO, "Error finalising save complete: %s",
+                     messages_get_errorcode(res));
+       }
+
        free(nsgtk_config_home);
 
        gtk_fetch_filetype_fin();


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

    resolve leak of attribute value lwc string in complete save

diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index 6cbefd6..4d98d2e 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -792,6 +792,7 @@ static bool save_complete_handle_attr(save_complete_ctx 
*ctx,
                        dom_string_unref(name);
                        return false;
                }
+               dom_string_unref(value);
        }
 
        dom_string_unref(name);


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

Summary of changes:
 desktop/save_complete.c |   82 +++++++++++++++++++++++++++++++----------------
 desktop/save_complete.h |    6 ++++
 frontends/gtk/gui.c     |    6 ++++
 3 files changed, 67 insertions(+), 27 deletions(-)

diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index 6cbefd6..1ecb313 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -140,14 +140,16 @@ save_complete_ctx_find_content(save_complete_ctx *ctx, 
const nsurl *url)
 }
 
 
-static bool save_complete_ctx_has_content(save_complete_ctx *ctx,
-               struct hlcache_handle *content)
+static bool
+save_complete_ctx_has_content(save_complete_ctx *ctx,
+                             struct hlcache_handle *content)
 {
        save_complete_entry *entry;
 
-       for (entry = ctx->list; entry != NULL; entry = entry->next)
+       for (entry = ctx->list; entry != NULL; entry = entry->next) {
                if (entry->content == content)
                        return true;
+       }
 
        return false;
 }
@@ -409,8 +411,10 @@ save_complete_save_stylesheet(save_complete_ctx *ctx, 
hlcache_handle *css)
        return result;
 }
 
-static bool save_complete_save_imported_sheets(save_complete_ctx *ctx,
-               struct nscss_import *imports, uint32_t import_count)
+static bool
+save_complete_save_imported_sheets(save_complete_ctx *ctx,
+                                  struct nscss_import *imports,
+                                  uint32_t import_count)
 {
        uint32_t i;
 
@@ -425,8 +429,9 @@ static bool 
save_complete_save_imported_sheets(save_complete_ctx *ctx,
        return true;
 }
 
-static bool save_complete_save_html_stylesheet(save_complete_ctx *ctx,
-               struct html_stylesheet *sheet)
+static bool
+save_complete_save_html_stylesheet(save_complete_ctx *ctx,
+                                  struct html_stylesheet *sheet)
 {
        if (sheet->sheet == NULL)
                return true;
@@ -756,8 +761,10 @@ static bool 
save_complete_handle_attr_value(save_complete_ctx *ctx,
        }
 }
 
-static bool save_complete_handle_attr(save_complete_ctx *ctx,
-               dom_string *node_name, dom_attr *attr)
+static bool
+save_complete_handle_attr(save_complete_ctx *ctx,
+                         dom_string *node_name,
+                         dom_attr *attr)
 {
        dom_string *name;
        const char *name_data;
@@ -792,6 +799,7 @@ static bool save_complete_handle_attr(save_complete_ctx 
*ctx,
                        dom_string_unref(name);
                        return false;
                }
+               dom_string_unref(value);
        }
 
        dom_string_unref(name);
@@ -799,8 +807,10 @@ static bool save_complete_handle_attr(save_complete_ctx 
*ctx,
        return true;
 }
 
-static bool save_complete_handle_attrs(save_complete_ctx *ctx,
-               dom_string *node_name, dom_namednodemap *attrs)
+static bool
+save_complete_handle_attrs(save_complete_ctx *ctx,
+                          dom_string *node_name,
+                          dom_namednodemap *attrs)
 {
        uint32_t length, i;
        dom_exception error;
@@ -830,8 +840,10 @@ static bool save_complete_handle_attrs(save_complete_ctx 
*ctx,
        return true;
 }
 
-static bool save_complete_handle_element(save_complete_ctx *ctx,
-               dom_node *node, save_complete_event_type event_type)
+static bool
+save_complete_handle_element(save_complete_ctx *ctx,
+                            dom_node *node,
+                            save_complete_event_type event_type)
 {
        dom_string *name;
        dom_namednodemap *attrs;
@@ -852,12 +864,12 @@ static bool 
save_complete_handle_element(save_complete_ctx *ctx,
        name_data = dom_string_data(name);
        name_len = dom_string_byte_length(name);
 
-       if (name_len == SLEN("base") &&
-                       strncasecmp(name_data, "base", name_len) == 0) {
+       if ((name_len == SLEN("base")) &&
+           (strncasecmp(name_data, "base", name_len) == 0)) {
                /* Elide BASE elements from the output */
                process = false;
-       } else if (name_len == SLEN("meta") &&
-                       strncasecmp(name_data, "meta", name_len) == 0) {
+       } else if ((name_len == SLEN("meta")) &&
+                  (strncasecmp(name_data, "meta", name_len) == 0)) {
                /* Don't emit close tags for META elements */
                if (event_type == EVENT_LEAVE) {
                        process = false;
@@ -865,7 +877,8 @@ static bool save_complete_handle_element(save_complete_ctx 
*ctx,
                        /* Elide meta charsets */
                        dom_string *value;
                        error = dom_element_get_attribute(node,
-                                       corestring_dom_http_equiv, &value);
+                                                 corestring_dom_http_equiv,
+                                                 &value);
                        if (error != DOM_NO_ERR) {
                                dom_string_unref(name);
                                return false;
@@ -907,8 +920,9 @@ static bool save_complete_handle_element(save_complete_ctx 
*ctx,
        }
 
        fputc('<', ctx->fp);
-       if (event_type == EVENT_LEAVE)
+       if (event_type == EVENT_LEAVE) {
                fputc('/', ctx->fp);
+       }
        fwrite(name_data, sizeof(*name_data), name_len, ctx->fp);
 
        if (event_type == EVENT_ENTER) {
@@ -978,8 +992,10 @@ static bool save_complete_handle_element(save_complete_ctx 
*ctx,
        return true;
 }
 
-static bool save_complete_node_handler(dom_node *node,
-               save_complete_event_type event_type, void *ctxin)
+static bool
+save_complete_node_handler(dom_node *node,
+                          save_complete_event_type event_type,
+                          void *ctxin)
 {
        save_complete_ctx *ctx = ctxin;
        dom_node_type type;
@@ -1097,8 +1113,10 @@ static bool save_complete_node_handler(dom_node *node,
        return true;
 }
 
-static bool save_complete_save_html_document(save_complete_ctx *ctx,
-               hlcache_handle *c, bool index)
+static bool
+save_complete_save_html_document(save_complete_ctx *ctx,
+                                hlcache_handle *c,
+                                bool index)
 {
        nserror ret;
        FILE *fp;
@@ -1133,8 +1151,9 @@ static bool 
save_complete_save_html_document(save_complete_ctx *ctx,
 
        doc = html_get_document(c);
 
-       if (save_complete_libdom_treewalk((dom_node *) doc,
-                       save_complete_node_handler, ctx) == false) {
+       if (save_complete_libdom_treewalk((dom_node *)doc,
+                                         save_complete_node_handler,
+                                         ctx) == false) {
                free(fname);
                guit->misc->warning("NoMemory", 0);
                fclose(fp);
@@ -1163,8 +1182,10 @@ static bool 
save_complete_save_html_document(save_complete_ctx *ctx,
  * \param  index  true to save as "index"
  * \return  true on success, false on error and error reported
  */
-static bool save_complete_save_html(save_complete_ctx *ctx, hlcache_handle *c,
-               bool index)
+static bool
+save_complete_save_html(save_complete_ctx *ctx,
+                       hlcache_handle *c,
+                       bool index)
 {
        if (content_get_type(c) != CONTENT_HTML)
                return false;
@@ -1271,6 +1292,13 @@ void save_complete_init(void)
 }
 
 /* Documented in save_complete.h */
+nserror save_complete_finalise(void)
+{
+       regfree(&save_complete_import_re);
+       return NSERROR_OK;
+}
+
+/* Documented in save_complete.h */
 bool
 save_complete(hlcache_handle *c,
              const char *path,
diff --git a/desktop/save_complete.h b/desktop/save_complete.h
index 3c389a5..f7f2507 100644
--- a/desktop/save_complete.h
+++ b/desktop/save_complete.h
@@ -44,6 +44,12 @@ typedef void (*save_complete_set_type_cb)(const char *path,
  */
 void save_complete_init(void);
 
+
+/**
+ * Finalise save complete module.
+ */
+nserror save_complete_finalise(void);
+
 /**
  * Save an HTML page with all dependencies.
  *
diff --git a/frontends/gtk/gui.c b/frontends/gtk/gui.c
index f14c7bd..ea8d77a 100644
--- a/frontends/gtk/gui.c
+++ b/frontends/gtk/gui.c
@@ -543,6 +543,12 @@ static void gui_quit(void)
                      messages_get_errorcode(res));
        }
 
+       res = save_complete_finalise();
+       if (res != NSERROR_OK) {
+               NSLOG(netsurf, INFO, "Error finalising save complete: %s",
+                     messages_get_errorcode(res));
+       }
+
        free(nsgtk_config_home);
 
        gtk_fetch_filetype_fin();


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