Skip to content

Commit

Permalink
fix bam->bai check
Browse files Browse the repository at this point in the history
  • Loading branch information
mktrost committed Jun 19, 2013
1 parent a0c6e8f commit 3961e3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bam_index.c
Expand Up @@ -341,8 +341,8 @@ bam_index_t *bam_index_load_local(const char *_fn)
strcpy(fnidx, fn); strcat(fnidx, ".bai");
fp = fopen(fnidx, "r");
if (fp == 0) { // try "{base}.bai"
char *s = strstr(fn, "bam");
if (s == fn + strlen(fn) - 3) {
if (strcmp(fn + strlen(fn) - 4, ".bam") == 0)
{
strcpy(fnidx, fn);
fnidx[strlen(fn)-1] = 'i';
fp = fopen(fnidx, "r");
Expand Down

0 comments on commit 3961e3d

Please sign in to comment.