aboutsummaryrefslogtreecommitdiff
path: root/src/sc_parse.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-01-29 22:10:53 +0100
committerThomas White <taw@physics.org>2018-01-29 22:10:53 +0100
commit6dedc1eb7742db4bcb06cb8459768a081f274903 (patch)
tree3e896cc885530fc47deb15d7bf601735affb1a8d /src/sc_parse.c
parent1dd2b61afed5f6f7d207ad9756e7b22108257205 (diff)
Fix incorrect handling when first frame is deleted
Diffstat (limited to 'src/sc_parse.c')
-rw-r--r--src/sc_parse.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/sc_parse.c b/src/sc_parse.c
index 28de7c2..9970566 100644
--- a/src/sc_parse.c
+++ b/src/sc_parse.c
@@ -263,7 +263,7 @@ int sc_block_unlink(SCBlock **top, SCBlock *deleteme)
}
if ( parent->child == deleteme ) {
- parent->child = NULL;
+ parent->child = deleteme->next;
}
return 0;
}
@@ -817,3 +817,14 @@ SCBlock *sc_block_split(SCBlock *bl, size_t pos)
return n;
}
+
+
+/* Return a new block which is the parent for "bl" */
+SCBlock *sc_block_new_parent(SCBlock *bl, const char *name)
+{
+ SCBlock *n = sc_block_new();
+ if ( n == NULL ) return NULL;
+ n->name = s_strdup(name);
+ n->child = bl;
+ return n;
+}