diff options
author | Thomas White <taw@physics.org> | 2020-03-10 14:33:57 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-07-29 18:42:24 +0200 |
commit | 30c69ebc7d0647e0935fc6b0cd35bcb9f5e01d95 (patch) | |
tree | 00f9e521cb929e4c00007d78301eb507f46e945f /src/crystfel_gui.c | |
parent | 8db13446c3db7108a5db6a9599bdb370b3fc7a47 (diff) |
Fix .cbf.gz
Diffstat (limited to 'src/crystfel_gui.c')
-rw-r--r-- | src/crystfel_gui.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/crystfel_gui.c b/src/crystfel_gui.c index 1a319f92..ad656ea8 100644 --- a/src/crystfel_gui.c +++ b/src/crystfel_gui.c @@ -182,12 +182,17 @@ enum match_type_id static int match_filename(const char *fn, enum match_type_id mt) { const char *ext = NULL; + const char *ext2 = NULL; size_t r = strlen(fn)-1; while ( r > 0 ) { if ( fn[r] == '.' ) { - ext = fn+r; - break; + if ( ext != NULL ) { + ext2 = fn+r; + break; + } else { + ext = fn+r; + } } r--; } @@ -201,7 +206,11 @@ static int match_filename(const char *fn, enum match_type_id mt) } if ( mt == MATCH_CHEETAH_CXI ) return strcmp(ext, ".cxi")==0; if ( mt == MATCH_CBF ) return strcmp(ext, ".cbf")==0; - if ( mt == MATCH_CBFGZ ) return strcmp(ext, ".cbfgz")==0; + if ( mt == MATCH_CBFGZ ) { + if ( ext2 != NULL ) { + return strcmp(ext2, ".cbf.gz")==0; + } + } return 0; } |