diff options
author | Thomas White <taw@bitwiz.org.uk> | 2014-07-07 22:58:25 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2014-07-07 22:58:25 +0200 |
commit | dd688c7838fd63a6e4fc0b59ed4fdc0afe9a1ee9 (patch) | |
tree | 8bcc0c62af00bd46b813531a955cb97281d240df /src/sc_parse.c | |
parent | b78321a41a1f8c6e75a8b9a1d774edc9ce7a5ed4 (diff) |
New frame logic
Diffstat (limited to 'src/sc_parse.c')
-rw-r--r-- | src/sc_parse.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/sc_parse.c b/src/sc_parse.c index a3443a0..0696e15 100644 --- a/src/sc_parse.c +++ b/src/sc_parse.c @@ -147,8 +147,7 @@ SCBlock *sc_block_append_inside(SCBlock *parent, while ( bl->next != NULL ) bl = bl->next; ptr = &bl->next; } else { - ptr = &bl->child; - bl = NULL; + ptr = &parent->child; } bln = sc_block_new(); @@ -454,6 +453,17 @@ SCBlock *sc_parse(const char *sc) } +SCBlock *find_last_child(SCBlock *bl) +{ + if ( bl == NULL ) return NULL; + if ( bl->child == NULL ) return NULL; + + bl = bl->child; + while ( bl->next != NULL ) bl = bl->next; + return bl; +} + + void sc_insert_text(SCBlock *b1, int o1, const char *t) { size_t len = strlen(b1->contents)+1+strlen(t); |