Changeset 18656 for gsdl/trunk
- Timestamp:
- 2009-03-11T11:06:35+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/common-src/src/lib/gdbmclass.cpp
r18051 r18656 72 72 if (gdbm_mode == GDBM_READER) 73 73 { 74 // If the specified GDBM file doesn't exist, try the other extension (we can now read both) 74 // make sure we have the right file extension. Should be db (for systems dbs, and gdb for collection dbs. But need to handle old style ldb/bdb 75 76 // If the specified GDBM file doesn't exist, (should be gdb) try the other extensions (we can now read both) 75 77 if (!file_exists(gdbm_filename)) 76 78 { 77 if (ends_with(gdbm_filename, ".ldb")) 78 { 79 gdbm_filename = substr(gdbm_filename.begin(), gdbm_filename.end() - ((text_t) ".ldb").size()) + ".bdb"; 80 } 81 else if (ends_with(gdbm_filename, ".bdb")) 82 { 83 gdbm_filename = substr(gdbm_filename.begin(), gdbm_filename.end() - ((text_t) ".bdb").size()) + ".ldb"; 79 if (ends_with(gdbm_filename, ".gdb")) { 80 // only try ldb and bdb for collection dbs, not system dbs which are .db 81 gdbm_filename = substr(gdbm_filename.begin(), gdbm_filename.end() - ((text_t) ".gdb").size()) + ".ldb"; 82 83 if (!file_exists(gdbm_filename)) { 84 // try bdb as well 85 gdbm_filename = substr(gdbm_filename.begin(), gdbm_filename.end() - ((text_t) ".ldb").size()) + ".bdb"; 86 } 84 87 } 85 88 } … … 146 149 text_t gdbmclass::getfileextension () 147 150 { 148 if (littleEndian()) return ".ldb"; 149 return ".bdb"; 151 // now we always use gdb for gdbm files. later on, if we can't find it, we'll try ldb and bdb for backwards compatibility 152 return ".gdb"; 153 //if (littleEndian()) return ".ldb"; 154 //return ".bdb"; 150 155 } 151 156
Note:
See TracChangeset
for help on using the changeset viewer.