projects
/
samtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Compress binary packages with xz.
[samtools.git]
/
bedidx.c
diff --git
a/bedidx.c
b/bedidx.c
index 722877dcc2aa1d414460c328e6e022a22befecfe..ec75a1067f5905c69ead868ff42d2073189bb690 100644
(file)
--- a/
bedidx.c
+++ b/
bedidx.c
@@
-4,6
+4,10
@@
#include <stdio.h>
#include <zlib.h>
#include <stdio.h>
#include <zlib.h>
+#ifdef _WIN32
+#define drand48() ((double)rand() / RAND_MAX)
+#endif
+
#include "ksort.h"
KSORT_INIT_GENERIC(uint64_t)
#include "ksort.h"
KSORT_INIT_GENERIC(uint64_t)
@@
-119,8
+123,10
@@
void *bed_read(const char *fn)
if (ks_getuntil(ks, 0, str, &dret) > 0 && isdigit(str->s[0])) {
beg = atoi(str->s); // begin
if (dret != '\n') {
if (ks_getuntil(ks, 0, str, &dret) > 0 && isdigit(str->s[0])) {
beg = atoi(str->s); // begin
if (dret != '\n') {
- if (ks_getuntil(ks, 0, str, &dret) > 0 && isdigit(str->s[0]))
+ if (ks_getuntil(ks, 0, str, &dret) > 0 && isdigit(str->s[0]))
{
end = atoi(str->s); // end
end = atoi(str->s); // end
+ if (end < beg) end = -1;
+ }
}
}
}
}
}
}