From 7f0818c80cf6aca8f50a637a0f1c3bd5e810e227 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 5 Mar 2009 11:00:00 +0000 Subject: Make hubbub parser binding build trees correctly (credit: Bo Yang) svn path=/trunk/dom/; revision=6711 --- src/core/string.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core') diff --git a/src/core/string.c b/src/core/string.c index 2540e26..3d30e3f 100644 --- a/src/core/string.c +++ b/src/core/string.c @@ -89,6 +89,14 @@ dom_exception dom_string_create(dom_alloc alloc, void *pw, { struct dom_string *ret; + if (ptr == NULL && len == 0) { + dom_string_ref(&empty_string); + + *str = &empty_string; + + return DOM_NO_ERR; + } + ret = alloc(NULL, sizeof(struct dom_string), pw); if (ret == NULL) return DOM_NO_MEM_ERR; -- cgit v1.2.3