Ignore:
Timestamp:
2008-12-03T16:10:34+13:00 (15 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.

File:
1 edited

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    }
Note: See TracChangeset for help on using the changeset viewer.