From 0243f814940b6f2a02664b5a19ef21e636e2af2e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 10 Oct 2019 20:33:59 +0200 Subject: Keep 'run' out of struct slide_pos --- libstorycode/storycode.y | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'libstorycode/storycode.y') diff --git a/libstorycode/storycode.y b/libstorycode/storycode.y index 587db4a..f3c2653 100644 --- a/libstorycode/storycode.y +++ b/libstorycode/storycode.y @@ -268,10 +268,18 @@ struct text_run **combine_paras(struct parse_many_paragraphs mp, int **pn_runs) combined_paras = malloc(mp.n_paras * sizeof(struct text_run *)); n_runs = malloc(mp.n_paras * sizeof(int)); for ( i=0; i 0 ) { + combined_paras[i] = mp.paras[i].runs; + n_runs[i] = mp.paras[i].n_runs; + } else { + /* Create a single dummy run */ + struct text_run *run; + run = malloc(sizeof(struct text_run)); + run->text = strdup(""); + run->type = TEXT_RUN_NORMAL; + combined_paras[i] = run; + n_runs[i] = 1; } - combined_paras[i] = mp.paras[i].runs; - n_runs[i] = mp.paras[i].n_runs; } *pn_runs = n_runs; -- cgit v1.2.3