Skip to content

Commit b0260a9

Browse files
committed
Fix failing tests, make expressions like this work: -i"F_MISSING>=1/5" (see also f4d7c27)
1 parent f4d7c27 commit b0260a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

filter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,6 @@ static void filters_set_alt_string(filter_t *flt, bcf1_t *line, token_t *tok)
13661366
}
13671367
static void filters_set_nmissing(filter_t *flt, bcf1_t *line, token_t *tok)
13681368
{
1369-
if ( !tok->nsamples ) error("The function %s works with FORMAT fields\n", tok->tag);
13701369
assert(tok->usmpl);
13711370

13721371
bcf_unpack(line, BCF_UN_FMT);
@@ -1409,7 +1408,8 @@ static void filters_set_nmissing(filter_t *flt, bcf1_t *line, token_t *tok)
14091408
default: fprintf(stderr,"todo: type %d\n", fmt->type); exit(1); break;
14101409
}
14111410
#undef BRANCH
1412-
tok->nvalues = 1;
1411+
tok->nsamples = 0;
1412+
tok->nvalues = 1;
14131413
tok->values[0] = tok->tag[0]=='N' ? nmissing : (nsmpl ? (double)nmissing / nsmpl : 0);
14141414
}
14151415
static int func_npass(filter_t *flt, bcf1_t *line, token_t *rtok, token_t **stack, int nstack)

0 commit comments

Comments
 (0)