File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -295,10 +295,12 @@ impl IndexedReader {
295295 // Create reader and require existence of index file.
296296 let ser_reader = unsafe { htslib:: bcf_sr_init ( ) } ;
297297 unsafe {
298+ // 0: BCF_SR_REQUIRE_IDX
298299 htslib:: bcf_sr_set_opt ( ser_reader, 0 ) ;
299- } // 0: BCF_SR_REQUIRE_IDX
300- // Attach a file with the path from the arguments.
301- if unsafe { htslib:: bcf_sr_add_reader ( ser_reader, path. as_ptr ( ) ) } >= 0 {
300+ }
301+ // Attach a file with the path from the arguments. 1 = success, 0 = fail
302+ // https://github.com/samtools/htslib/blob/develop/htslib/synced_bcf_reader.h#L232
303+ if unsafe { htslib:: bcf_sr_add_reader ( ser_reader, path. as_ptr ( ) ) } != 0 {
302304 let header = Arc :: new ( unsafe {
303305 HeaderView :: from_ptr ( htslib:: bcf_hdr_dup (
304306 ( * ( * ser_reader) . readers . offset ( 0 ) ) . header ,
You can’t perform that action at this time.
0 commit comments