From 78205cb1a3558f7c85661ee935d654e64972baa8 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Thu, 15 Feb 2007 17:23:39 +0000 Subject: [PATCH] patch to correct bug in switch between parts of the sequence database git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPCR/trunk@8 60f365c0-8329-0410-b2a4-ec073aeeaa1d --- src/libecoPCR/ecoseq.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/libecoPCR/ecoseq.c b/src/libecoPCR/ecoseq.c index 2b5b56a..cc25ad5 100644 --- a/src/libecoPCR/ecoseq.c +++ b/src/libecoPCR/ecoseq.c @@ -152,6 +152,9 @@ FILE *open_seqfile(const char *prefix,int32_t index) "%s_%03d.sdx", prefix, index); + + fprintf(stderr,"Coucou %s\n",filename_buffer); + if (filename_length >= 1024) ECOERROR(ECO_ASSERT_ERROR,"file name is too long"); @@ -172,6 +175,7 @@ ecoseq_t *ecoseq_iterator(const char *prefix) { static FILE *current_seq_file= NULL; static int32_t current_file_idx = 1; + static char current_prefix[1024]; ecoseq_t *seq; if (prefix) @@ -180,8 +184,11 @@ ecoseq_t *ecoseq_iterator(const char *prefix) if (current_seq_file) fclose(current_seq_file); + + strncpy(current_prefix,prefix,1023); + current_prefix[1024]=0; - current_seq_file = open_seqfile(prefix, + current_seq_file = open_seqfile(current_prefix, current_file_idx); if (!current_seq_file) @@ -195,8 +202,10 @@ ecoseq_t *ecoseq_iterator(const char *prefix) { current_file_idx++; fclose(current_seq_file); - current_seq_file = open_seqfile(prefix, + current_seq_file = open_seqfile(current_prefix, current_file_idx); + + if (current_seq_file) seq = readnext_ecoseq(current_seq_file); }