Skip to content

Commit 4469ab1

Browse files
jkbonfieldwhitwham
authored andcommitted
Permit 2 letter extension in find_file_extension.
sam_open_mode checks for ".fa" and ".fq" extension types, but these were never returned before as it had a hard rule of >= 3 characters.
1 parent 4424468 commit 4469ab1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

hts_internal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ static inline int find_file_extension(const char *fn, char ext_out[static HTS_MA
139139
{
140140
for (ext--; ext > fn && *ext != '.' && *ext != '/'; --ext) {}
141141
}
142-
if (*ext != '.' || delim - ext > HTS_MAX_EXT_LEN || delim - ext < 4) return -1;
142+
if (*ext != '.' || delim - ext > HTS_MAX_EXT_LEN || delim - ext < 3)
143+
return -1;
143144
memcpy(ext_out, ext + 1, delim - ext - 1);
144145
ext_out[delim - ext - 1] = '\0';
145146
return 0;

0 commit comments

Comments
 (0)