Changeset 18039

Show
Ignore:
Timestamp:
03.12.2008 16:10:34 (11 years ago)
Author:
mdewsnip
Message:

Added extra code to leave the 4-byte strings in each hash table entry alone. This doesn't matter for db2txt but it matters a lot for Greenstone and gdbmget, since these access the database by a known key.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/common-src/packages/gdbm/gdbm-1.8.3/bucket.c

    r18038 r18039  
    122122      { 
    123123    endian_swap_array((int*) dbf->bucket, dbf->header->bucket_size); 
     124 
     125    // There is a 4-byte string in each hash table entry that we need to leave alone (because character 
     126    //   strings are not affected by endianness), so convert these back to how they were originally 
     127    int b; 
     128    for (b = 0; b < dbf->bucket->count; b++) 
     129    { 
     130      int* key_start = (int*) dbf->bucket->h_table[b].key_start; 
     131      *key_start = endian_swap (*key_start); 
     132    } 
    124133      } 
    125134    }