This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
Similar to samtools/samtools#1909, this is a companion pull request to samtools/htslib#1665. Now that hts_open("-", "w") / hts_close() no longer actually closes stdout. Close it explicitly at the end of main() when a subcommand may have written to stdout, so there is an opportunity to detect I/O errors in previously-uncommitted writes.
Ignore EBADF as other code may have already closed stdout, e.g., either particular subcommands or when (dynamically) linked against an older version of HTSlib.
Also trivially: include <strings.h> where needed to ensure strcasecmp() et al are declared. (<strings.h> is often a byproduct of <string.h> but POSIX doesn't require that.)
Similar to samtools/samtools#1909, this is a companion pull request to samtools/htslib#1665. Now that
hts_open("-", "w")
/hts_close()
no longer actually closes stdout. Close it explicitly at the end ofmain()
when a subcommand may have written to stdout, so there is an opportunity to detect I/O errors in previously-uncommitted writes.Ignore EBADF as other code may have already closed stdout, e.g., either particular subcommands or when (dynamically) linked against an older version of HTSlib.
Also trivially: include
<strings.h>
where needed to ensurestrcasecmp()
et al are declared. (<strings.h>
is often a byproduct of<string.h>
but POSIX doesn't require that.)