diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2006-10-29 13:10:32 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2006-10-29 13:10:32 +0000 |
| commit | 605749e04d7b719bef0c4101be7dec38e0108cc2 (patch) | |
| tree | f34877c570077d1e75f2fc3e5f83061a9a47a8d6 | |
| parent | 42f573a9fcb1ea8db175cf61c8891e54895050d8 (diff) | |
handle "1" as well as "true" in booleans
| -rw-r--r-- | lasso/xml/xml.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index db83ccbb..fce0f063 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -438,7 +438,12 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode) (*(int*)value) = val; xmlFree(tmp); } else if (snippet->type & SNIPPET_BOOLEAN) { - int val = (strcmp((char*)tmp, "true") == 0); + int val = 0; + if (strcmp((char*)tmp, "true") == 0) { + val = 1; + } else if (strcmp((char*)tmp, "1") == 0) { + val = 1; + } (*(int*)value) = val; xmlFree(tmp); } else { @@ -471,7 +476,12 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode) (*(int*)value) = val; xmlFree(tmp); } else if (snippet->type & SNIPPET_BOOLEAN) { - int val = (strcmp((char*)tmp, "true") == 0); + int val = 0; + if (strcmp((char*)tmp, "true") == 0) { + val = 1; + } else if (strcmp((char*)tmp, "1") == 0) { + val = 1; + } (*(int*)value) = val; xmlFree(tmp); } else { |
