aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-09-30 17:45:34 +0200
committerThomas White <taw@physics.org>2020-09-30 17:47:14 +0200
commit95d812b9f9aadff2d0681729e01802e845e15c09 (patch)
treef1bcb87d60b158008575106019fb85587528042a
parent4b746eb1114e8ce59dada01c24b0b94870e8199a (diff)
indexamajig: Don't stop on first multi-frame file with no frames
-rw-r--r--src/im-sandbox.c46
1 files 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);