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
This commit is contained in:
@ -153,6 +153,9 @@ FILE *open_seqfile(const char *prefix,int32_t index)
|
||||
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)
|
||||
@ -181,7 +185,10 @@ ecoseq_t *ecoseq_iterator(const char *prefix)
|
||||
if (current_seq_file)
|
||||
fclose(current_seq_file);
|
||||
|
||||
current_seq_file = open_seqfile(prefix,
|
||||
strncpy(current_prefix,prefix,1023);
|
||||
current_prefix[1024]=0;
|
||||
|
||||
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user