Correzione al lavoro precedente
git-svn-id: svn://10.65.10.50/trunk@2702 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d66747e754
commit
a15ab43cd8
@ -755,12 +755,12 @@ int DB_packmemo(short vis, const char * filename)
|
|||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
Elimina i record duplicati
|
Elimina i record duplicati
|
||||||
--------------------------------------------------------------------------*/
|
--------------------------------------------------------------------------*/
|
||||||
int DB_clean_file(int handle, const char * filename, char * ff, RecDes * r, bool vis)
|
int DB_clean_file(int handle, char * filename, char * ff, RecDes * r, short vis)
|
||||||
{
|
{
|
||||||
TAG4INFO tags[2];
|
TAG4INFO tags[2];
|
||||||
TAG4 * t;
|
TAG4 * t;
|
||||||
char s[256];
|
char s[256], s0[256];
|
||||||
int l = 0, rt = 0;
|
int l = 0, lt = 0, rt = 0;
|
||||||
long cnt = 0;
|
long cnt = 0;
|
||||||
INDEX4 *w = NULL;
|
INDEX4 *w = NULL;
|
||||||
long items = DB_reccount(handle);
|
long items = DB_reccount(handle);
|
||||||
@ -777,7 +777,8 @@ int DB_clean_file(int handle, const char * filename, char * ff, RecDes * r, bool
|
|||||||
u4free(tags[0].filter);
|
u4free(tags[0].filter);
|
||||||
if (w == NULL) return code_base.error_code;
|
if (w == NULL) return code_base.error_code;
|
||||||
t = d4tag_default(dbdata[handle]);
|
t = d4tag_default(dbdata[handle]);
|
||||||
l = expr4key_len(t->expr) - 9;
|
lt = expr4key_len(t->expr);
|
||||||
|
l = lt - 9;
|
||||||
#ifndef FOXPRO
|
#ifndef FOXPRO
|
||||||
if (vis)
|
if (vis)
|
||||||
progind_create(items,"Ricerca record duplicati",1,1,1);
|
progind_create(items,"Ricerca record duplicati",1,1,1);
|
||||||
@ -787,7 +788,7 @@ int DB_clean_file(int handle, const char * filename, char * ff, RecDes * r, bool
|
|||||||
|
|
||||||
while (code_base.error_code == 0)
|
while (code_base.error_code == 0)
|
||||||
{
|
{
|
||||||
const char* s0 = t4key(t);
|
strncpy(s0, t4key(t), lt);
|
||||||
|
|
||||||
#ifndef FOXPRO
|
#ifndef FOXPRO
|
||||||
if (vis)
|
if (vis)
|
||||||
@ -798,9 +799,10 @@ int DB_clean_file(int handle, const char * filename, char * ff, RecDes * r, bool
|
|||||||
{
|
{
|
||||||
x4go(&xdb[handle],t4recno(t));
|
x4go(&xdb[handle],t4recno(t));
|
||||||
d4delete(dbdata[handle]);
|
d4delete(dbdata[handle]);
|
||||||
|
t4seek(t, s0, lt);
|
||||||
}
|
}
|
||||||
strncpy(s, s0, l);
|
strncpy(s, s0, lt);
|
||||||
if (t4skip(t, -1L) == 0)
|
if (t4skip(t, -1L) >= 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
} // while
|
} // while
|
||||||
|
Loading…
x
Reference in New Issue
Block a user