From ae91233fd262d0345ea136c118f7462c8842df2c Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Thu, 14 Mar 2002 08:15:22 +0000 Subject: [PATCH] 2002-03-14 11:12 UTC+0300 Alexander Kresin --- harbour/ChangeLog | 5 +++++ harbour/source/rdd/dbcmd.c | 24 ++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 90667630e5..aee7a59bd8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,11 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ +2002-03-16 19:31 UTC-0300 Horacio Roldan + * source/rdd/dbfcdx/dbfcdx1.c + ! fixed bug with keys updating + +2002-03-15 08:50 UTC-0800 Ron Pinkas * contrib\dot\pp.prg * contrib\dot\pp_harb.ch * contrib\dot\prgscrpt.prg diff --git a/harbour/source/rdd/dbcmd.c b/harbour/source/rdd/dbcmd.c index 12c9af68e4..ae9e9bc13c 100644 --- a/harbour/source/rdd/dbcmd.c +++ b/harbour/source/rdd/dbcmd.c @@ -3372,11 +3372,22 @@ HB_FUNC( DBEXISTS ) // check if the field is on the Fields Array static BOOL IsFieldIn( char * fieldName, PHB_ITEM pFields ) { - USHORT i, uiFields = ( USHORT ) hb_arrayLen( pFields ); + USHORT i, j, uiFields = ( USHORT ) hb_arrayLen( pFields ); + char *ptr; + BOOL lresult; + for ( i=0; iitem.asArray.value->pItems + i; - if ( strcmp( fieldName, (char *)pField->item.asString.value ) == 0 ) + ptr = (char *)pField->item.asString.value; + lresult = TRUE; + for( j=0;*ptr;j++,ptr++ ) + if( *(fieldName+j) != toupper(*ptr) ) + { + lresult = FALSE; + break; + } + if ( lresult ) return TRUE; } return FALSE; @@ -3455,6 +3466,15 @@ static LPAREANODE GetTheOtherArea( char *szDriver, char * szFileName, BOOL creat } hb_itemRelease( pItem ); hb_itemRelease( pData ); + if( !hb_arrayLen( pFieldArray ) ) + { + hb_itemRelease( pFieldArray ); + SELF_RELEASE( ( AREAP ) pAreaNode->pArea ); + hb_xfree( pInfo.abName ); + hb_xfree( pAreaNode ); + hb_errRT_DBCMD( EG_ARG, EDBCMD_BADPARAMETER, NULL, "DBCREATE" ); + return NULL; + } /* check for table existence and if true, drop it */ tableItem = hb_itemNew( NULL );