check *.64.bwt first and then *.bwt
This commit is contained in:
parent
c875085b2b
commit
d33abf127f
10
bwtaln.c
10
bwtaln.c
|
|
@ -227,17 +227,19 @@ char *bwa_infer_prefix(const char *hint)
|
|||
l_hint = strlen(hint);
|
||||
prefix = malloc(l_hint + 3 + 4 + 1);
|
||||
strcpy(prefix, hint);
|
||||
strcpy(prefix + l_hint, ".bwt");
|
||||
strcpy(prefix + l_hint, ".64.bwt");
|
||||
if ((fp = fopen(prefix, "rb")) != 0) {
|
||||
prefix[l_hint] = 0;
|
||||
fclose(fp);
|
||||
prefix[l_hint + 3] = 0;
|
||||
return prefix;
|
||||
} else {
|
||||
strcpy(prefix + l_hint, ".64.bwt");
|
||||
strcpy(prefix + l_hint, ".bwt");
|
||||
if ((fp = fopen(prefix, "rb")) == 0) {
|
||||
free(prefix);
|
||||
return 0;
|
||||
} else {
|
||||
prefix[l_hint + 3] = 0;
|
||||
fclose(fp);
|
||||
prefix[l_hint] = 0;
|
||||
return prefix;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue