From 7c4cc4fab04d5cb0c2727d8722c7469c1828b9ad Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 13 Feb 2015 21:05:00 +0100 Subject: Fix serialization of StoryCode --- src/sc_parse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sc_parse.c b/src/sc_parse.c index 0f8e893..e4f0e0e 100644 --- a/src/sc_parse.c +++ b/src/sc_parse.c @@ -258,6 +258,14 @@ void save_sc_block(FILE *fh, const SCBlock *bl) fprintf(fh, "%s", bl->contents); } + /* Special case to prevent "\somethingSome text" */ + if ( (bl->name != NULL) && (bl->options == NULL) + && (bl->contents == NULL) && (bl->next != NULL) + && (bl->next->name == NULL) && (bl->child == NULL) ) + { + fprintf(fh, "{}"); + } + } if ( bl->child != NULL ) { -- cgit v1.2.3