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
|
||||
--------------------------------------------------------------------------*/
|
||||
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];
|
||||
TAG4 * t;
|
||||
char s[256];
|
||||
int l = 0, rt = 0;
|
||||
char s[256], s0[256];
|
||||
int l = 0, lt = 0, rt = 0;
|
||||
long cnt = 0;
|
||||
INDEX4 *w = NULL;
|
||||
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);
|
||||
if (w == NULL) return code_base.error_code;
|
||||
t = d4tag_default(dbdata[handle]);
|
||||
l = expr4key_len(t->expr) - 9;
|
||||
lt = expr4key_len(t->expr);
|
||||
l = lt - 9;
|
||||
#ifndef FOXPRO
|
||||
if (vis)
|
||||
progind_create(items,"Ricerca record duplicati",1,1,1);
|
||||
@ -787,20 +788,21 @@ int DB_clean_file(int handle, const char * filename, char * ff, RecDes * r, bool
|
||||
|
||||
while (code_base.error_code == 0)
|
||||
{
|
||||
const char* s0 = t4key(t);
|
||||
strncpy(s0, t4key(t), lt);
|
||||
|
||||
#ifndef FOXPRO
|
||||
if (vis)
|
||||
progind_set_status(++cnt);
|
||||
#endif
|
||||
|
||||
|
||||
if (!strncmp(s, s0, l))
|
||||
{
|
||||
x4go(&xdb[handle],t4recno(t));
|
||||
d4delete(dbdata[handle]);
|
||||
}
|
||||
strncpy(s, s0, l);
|
||||
if (t4skip(t, -1L) == 0)
|
||||
t4seek(t, s0, lt);
|
||||
}
|
||||
strncpy(s, s0, lt);
|
||||
if (t4skip(t, -1L) >= 0)
|
||||
break;
|
||||
|
||||
} // while
|
||||
|
Loading…
x
Reference in New Issue
Block a user