aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/image-hdf5.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libcrystfel/src/image-hdf5.c b/libcrystfel/src/image-hdf5.c
index 13d0c5ed..a203f6ac 100644
--- a/libcrystfel/src/image-hdf5.c
+++ b/libcrystfel/src/image-hdf5.c
@@ -207,6 +207,15 @@ static char *substitute_path(const char *ev, const char *pattern)
return NULL;
}
+ if ( n_pl_exp == 0 ) {
+ /* No placeholders in path */
+ for ( i=0; i<n_plvals; i++ ) {
+ free(plvals[i]);
+ }
+ free(plvals);
+ return strdup(pattern);
+ }
+
total_len = strlen(pattern) - n_pl_exp;
for ( i=0; i<n_plvals; i++ ) {
total_len += strlen(plvals[i]);