Skip to content

Commit 7ef3fea

Browse files
committed
fixed a new multi-query problem
1 parent a0fb46f commit 7ef3fea

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ R --no-site-file --no-environ --no-save --no-restore CMD INSTALL --install-tests
5050
To install a specific version,
5151
```
5252
library(devtools)
53-
install_url("https://github.com/4dn-dcic/Rpairix/archive/0.1.2.zip")
53+
install_url("https://github.com/4dn-dcic/Rpairix/archive/0.1.3.zip")
5454
```
5555

5656

@@ -277,6 +277,9 @@ Individual R functions are written and documented in `R/`. The `src/rpairixlib.c
277277
***
278278

279279
## Version history
280+
### 0.1.3
281+
* `px_query`: fixed a new problem (since 0.1.2) with multi-query returning only the last query result.
282+
280283
### 0.1.2
281284
* Function `px_get_column_names` is now added.
282285
* `px_query` now adds column names for the query result if indexing was done with `pairs` preset.

src/rpairixlib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,11 @@ SEXP get_lines(SEXP _r_pfn, SEXP _r_pquerystr, SEXP _r_pnquery, SEXP _r_pn){
296296
SEXP _r_presultstr_line[*pn];
297297
if(tb){
298298
const ti_conf_t *pconf = ti_get_conf(tb->idx);
299-
int i, ires=0; // i is index for querystr, ires is index for result line
299+
int i, ires=0, k=0; // i is index for querystr, ires is index for result line
300300
for(i=0;i<*pnquery;i++){
301301
ti_iter_t iter = ti_querys_2d(tb, pquerystr[i]);
302302
char *s;
303-
int len=-1,k=0;
303+
int len=-1;
304304
while ((s = ti_read(tb, iter, &len)) != 0) {
305305
int j,start=0,m=0; // j is position on result line, start is start position of the current column, m is the index of the current column
306306
if(ncols==0) for(j=0;j<=len;j++) if(s[j]==pconf->delimiter||s[j]==0) ncols++;

0 commit comments

Comments
 (0)