Imported Upstream version 0.1.1
[tabix.git] / index.c
diff --git a/index.c b/index.c
index cc564981ee5696f0d3350298312287c516946f85..80b863d3f84d53ea4c8eafb612db56150c94870a 100644 (file)
--- a/index.c
+++ b/index.c
@@ -159,8 +159,8 @@ static int get_intv(ti_index_t *idx, kstring_t *str, ti_intv_t *intv)
                                if (i != str->l) str->s[i] = '\t';
                        } else if (id == idx->conf.bc) {
                                // here ->beg is 1-based. it will be changed to 0-based at the end of this routine.
-                               intv->beg = strtol(str->s + b, &s, 0);
-                               if (idx->conf.preset&TI_FLAG_UCSC) ++intv->beg;
+                               intv->beg = intv->end = strtol(str->s + b, &s, 0);
+                               if (!(idx->conf.preset&TI_FLAG_UCSC)) --intv->beg;
                        } else {
                                if ((idx->conf.preset&0xffff) == TI_PRESET_GENERIC) {
                                        if (id == idx->conf.ec) intv->end = strtol(str->s + b, &s, 0);