aboutsummaryrefslogtreecommitdiff
path: root/src/stylesheet.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-05-24 08:35:41 +0200
committerThomas White <taw@bitwiz.org.uk>2013-05-24 08:35:41 +0200
commit6647f70cb376a0b123f5c4665985b8c343f3e3c0 (patch)
treefb8fb375cb59322ff70bca46197495c6038da34c /src/stylesheet.c
parentf0a7b2531afdbe630c42a4c5ac57f1a69c553212 (diff)
Loading stuff
Diffstat (limited to 'src/stylesheet.c')
-rw-r--r--src/stylesheet.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/stylesheet.c b/src/stylesheet.c
index d48ed85..b6fec5c 100644
--- a/src/stylesheet.c
+++ b/src/stylesheet.c
@@ -99,6 +99,7 @@ StyleSheet *default_stylesheet()
{
char *v;
struct ds_node *root;
+ struct ds_node *ss_root;
StyleSheet *ss;
size_t len;
@@ -111,7 +112,14 @@ StyleSheet *default_stylesheet()
root = new_ds_node("root");
deserialize_memory(v, root);
- ss = tree_to_stylesheet(root);
+
+ ss_root = find_node(root, "stylesheet", 0);
+ if ( ss_root == NULL ) {
+ fprintf(stderr, "Doesn't look like a stylesheet.\n");
+ return NULL;
+ }
+ ss = tree_to_stylesheet(ss_root);
+ free_ds_tree(root);
free(v);
return ss;
}
@@ -170,9 +178,9 @@ StyleSheet *tree_to_stylesheet(struct ds_node *root)
}
- node = find_node(root, "bgblocks", 0);
+ node = find_node(root, "templates", 0);
if ( node == NULL ) {
- fprintf(stderr, "Couldn't find bgblocks\n");
+ fprintf(stderr, "Couldn't find templates\n");
free_stylesheet(ss);
return NULL;
}