r10881 jmb - in /trunk/netsurf/render: html.c html.h

netsurf at semichrome.net netsurf at semichrome.net
Mon Oct 11 07:54:37 BST 2010


Author: jmb
Date: Mon Oct 11 01:54:37 2010
New Revision: 10881

URL: http://source.netsurf-browser.org?rev=10881&view=rev
Log:
Fix crash when top-level content is not HTML and there is a fragment identifier in the URL.
Constify.

Modified:
    trunk/netsurf/render/html.c
    trunk/netsurf/render/html.h

Modified: trunk/netsurf/render/html.c
URL: http://source.netsurf-browser.org/trunk/netsurf/render/html.c?rev=10881&r1=10880&r2=10881&view=diff
==============================================================================
--- trunk/netsurf/render/html.c (original)
+++ trunk/netsurf/render/html.c Mon Oct 11 01:54:37 2010
@@ -2220,13 +2220,15 @@
  * \param y        Updated to global y coord iff id found
  * \return  true iff id found
  */
-bool html_get_id_offset(hlcache_handle *h, char *frag_id, int *x, int *y)
+bool html_get_id_offset(hlcache_handle *h, const char *frag_id, int *x, int *y)
 {
 	struct box *pos;
-	struct box *layout = html_get_box_tree(h);
+	struct box *layout;
 
 	if (content_get_type(h) != CONTENT_HTML)
 		return false;
+
+	layout = html_get_box_tree(h);
 
 	if ((pos = box_find_by_id(layout, frag_id)) != 0) {
 		box_coords(pos, x, y);

Modified: trunk/netsurf/render/html.h
URL: http://source.netsurf-browser.org/trunk/netsurf/render/html.h?rev=10881&r1=10880&r2=10881&view=diff
==============================================================================
--- trunk/netsurf/render/html.h (original)
+++ trunk/netsurf/render/html.h Mon Oct 11 01:54:37 2010
@@ -247,7 +247,7 @@
 struct content_html_object *html_get_objects(struct hlcache_handle *h, 
 		unsigned int *n);
 struct hlcache_handle *html_get_favicon(struct hlcache_handle *h);
-bool html_get_id_offset(struct hlcache_handle *h, char *frag_id,
+bool html_get_id_offset(struct hlcache_handle *h, const char *frag_id,
 		int *x, int *y);
 
 #endif




More information about the netsurf-commits mailing list