From 05318b210daaa6d68b74f154fef1dae81503eaa8 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Wed, 26 Feb 2003 18:22:24 +0000 Subject: [PATCH] [project @ 2003-02-26 18:22:24 by bursa] Fix HTML parsing and JPEG bug. svn path=/import/netsurf/; revision=101 --- desktop/browser.c | 6 ++++-- render/html.c | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/desktop/browser.c b/desktop/browser.c index fc93de7ce..cb64d22f2 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -1,5 +1,5 @@ /** - * $Id: browser.c,v 1.26 2003/02/25 21:00:27 bursa Exp $ + * $Id: browser.c,v 1.27 2003/02/26 18:22:24 bursa Exp $ */ #include "netsurf/content/cache.h" @@ -503,7 +503,9 @@ void browser_window_follow_link(struct browser_window* bw, click_boxes = NULL; plot_index = 0; - assert(bw->current_content->type == CONTENT_HTML); + if (bw->current_content->type != CONTENT_HTML) + return; + box_under_area(bw->current_content->data.html.layout->children, click_x, click_y, 0, 0, &click_boxes, &found, &plot_index); diff --git a/render/html.c b/render/html.c index e8d2f69b2..3548895e7 100644 --- a/render/html.c +++ b/render/html.c @@ -1,5 +1,5 @@ /** - * $Id: html.c,v 1.2 2003/02/25 21:00:27 bursa Exp $ + * $Id: html.c,v 1.3 2003/02/26 18:22:24 bursa Exp $ */ #include @@ -32,10 +32,11 @@ void html_create(struct content *c) void html_process_data(struct content *c, char *data, unsigned long size) { unsigned long x; - for (x = 0; x < size; x += CHUNK) { + for (x = 0; x + CHUNK <= size; x += CHUNK) { htmlParseChunk(c->data.html.parser, data + x, CHUNK, 0); gui_multitask(); } + htmlParseChunk(c->data.html.parser, data + x, size - x, 0); }