 +          } // if qnameid == qnameid2
 +        } // for prev2,bp2
 +        if (NULL == bp2) {
++          bamptr_set_mate(bp, NULL);
++
 +          short const flag = bamptr_get_flag(bp);
 +          if ((flag & BAM_FPAIRED) && !(flag & BAM_FMUNMAP)) {
 +            char qname[128];

+    qname_hash_bucket = md_malloc(sizeof(*qname_hash_bucket)*QNAME_HASH_SIZE, mem_bamGetQnameId1, 1);
+}
+PROFILE_MEM_INIT();
+fprintf(stderr, "(I) sam-to-bam $Rev: 82 $\n");
+#if !defined(DEBUG_POS)
+fprintf(stderr, "(I) **** built with no DEBUG_POS feature\n");
+#endif

# DEALINGS IN THE SOFTWARE.
diff -uprN -x '*_Jul11' -x 'ibm_*' -x 'Numer*' -x a.out -x '#*#' -x version.h -x q -x '*~' -x '*.c.*' -x '*.a' -x .git -x .svn -x '*.MIT' 00_svn_r2/samtools-2015-08-19/samtools/bam_sam2bam.c ../files/samtools/bam_sam2bam.c
--- 00_svn_r2/samtools-2015-08-19/samtools/bam_sam2bam.c	1970-01-01 09:00:00.000000000 +0900
+++ ../files/samtools/bam_sam2bam.c	2016-10-26 10:49:06.586614172 +0900
@@ -0,0 +1,7841 @@
+#define _BAM_SAM2BAM_C
+/*  bam_sam2bam.c
+
