From 287986b28a9290cc46ef585bfcc47782ea55cc70 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Mon, 22 Sep 2003 21:55:08 +0000 Subject: [project @ 2003-09-22 21:55:08 by bursa] Experimental textarea editing code. svn path=/import/netsurf/; revision=309 --- render/box.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'render/box.c') diff --git a/render/box.c b/render/box.c index c8c435179..e5e363fbd 100644 --- a/render/box.c +++ b/render/box.c @@ -709,8 +709,7 @@ struct result box_textarea(xmlNode *n, struct status *status, /* split the content at newlines and make an inline container with an * inline box for each line */ current = content = xmlNodeGetContent(n); - current += strspn(current, "\r\n"); /* skip any initial CR, LF */ - while (*current) { + do { size_t len = strcspn(current, "\r\n"); char old = current[len]; current[len] = 0; @@ -727,7 +726,7 @@ struct result box_textarea(xmlNode *n, struct status *status, current[len] = old; current += len; current += strspn(current, "\r\n"); - } + } while (*current); xmlFree(content); if ((s = (char *) xmlGetProp(n, (const xmlChar *) "name"))) @@ -1444,8 +1443,6 @@ void gadget_free(struct gui_gadget* g) xmlFree(g->data.checkbox.value); break; case GADGET_TEXTAREA: - if (g->data.textarea.text != 0) - xmlFree(g->data.textarea.text); break; case GADGET_TEXTBOX: gui_remove_gadget(g); -- cgit v1.2.3