From 95d812b9f9aadff2d0681729e01802e845e15c09 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 30 Sep 2020 17:45:34 +0200 Subject: indexamajig: Don't stop on first multi-frame file with no frames --- src/im-sandbox.c | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/src/im-sandbox.c b/src/im-sandbox.c index 1024b738..a373994a 100644 --- a/src/im-sandbox.c +++ b/src/im-sandbox.c @@ -263,30 +263,34 @@ static int get_pattern(struct get_pattern_ctx *gpctx, return 1; } - /* No events in list. Time to top it up */ - filename = read_prefixed_filename(gpctx, &evstr); + do { - /* Nothing left in file -> we're done */ - if ( filename == NULL ) return 0; + /* No events in list. Time to top it up */ + filename = read_prefixed_filename(gpctx, &evstr); - /* Does the line from the input file contain an event ID? - * If so, just send it straight back. */ - if ( evstr != NULL ) { - *pfilename = filename; - *pevent = evstr; - return 1; - } + /* Nothing left in file -> we're done */ + if ( filename == NULL ) return 0; - /* We got a filename, but no event. Attempt to expand... */ - free(gpctx->events); /* Free the old list. - * NB The actual strings were freed - * by fill_queue */ - gpctx->events = image_expand_frames(gpctx->dtempl, filename, - &gpctx->n_events); - if ( gpctx->events == NULL ) { - ERROR("Failed to get event list.\n"); - return 0; - } + /* Does the line from the input file contain an event ID? + * If so, just send it straight back. */ + if ( evstr != NULL ) { + *pfilename = filename; + *pevent = evstr; + return 1; + } + + /* We got a filename, but no event. Attempt to expand... */ + free(gpctx->events); /* Free the old list. + * NB The actual strings were freed + * by fill_queue */ + gpctx->events = image_expand_frames(gpctx->dtempl, filename, + &gpctx->n_events); + if ( gpctx->events == NULL ) { + ERROR("Failed to get event list from %s.\n", + filename); + } + + } while ( gpctx->events == NULL ); /* Save filename for next time */ free(gpctx->filename); -- cgit v1.2.3