diff options
author | Thomas White <taw@physics.org> | 2020-06-16 17:02:31 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-07-29 18:53:44 +0200 |
commit | 871a9a1f4a505d932672a62e389067f0125fc0e0 (patch) | |
tree | 3f605b45a5db1ded1ab92fe68b70293b55c26e3d | |
parent | 9d958b9db93e2009f403ad81fc7846036914f8fe (diff) |
substitute_path: Special case for no placeholders
-rw-r--r-- | libcrystfel/src/image-hdf5.c | 9 |
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]); |