Changeset 3749

Show
Ignore:
Timestamp:
02/19/09 12:59:31 (3 years ago)
Author:
pramsey
Message:

Add EOF marker, per GBT#105

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/loader/dbfopen.c

    r3561 r3749  
    508508    if( psDBF->bUpdated ) 
    509509        DBFUpdateHeader( psDBF ); 
     510 
     511/* -------------------------------------------------------------------- */ 
     512/*  Add the DBF end-of-file marker after the last record.               */ 
     513/* -------------------------------------------------------------------- */ 
     514 
     515    fseek(psDBF->fp, -1, SEEK_END); 
     516    fread(&eof_test, 1, 1, psDBF->fp); 
     517    if( eof_test != 0x1a ) /* no EOF exists, so write one */ 
     518    { 
     519        fseek(psDBF->fp, 0, SEEK_END); 
     520        fwrite(&eof, 1, 1, psDBF->fp); 
     521    } 
    510522 
    511523/* -------------------------------------------------------------------- */