mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-01-22 02:52:05 +08:00
Handle 'file not found' case
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
Thu Jun 16 21:19:37 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
Thu Jun 16 21:19:37 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
||||||
* src/libmdb/data.c: Fix segmentation fault
|
* src/libmdb/data.c: Fix segmentation fault
|
||||||
* src/libmdb/write.c: Fix bug in handling certain 'jump tables'
|
* src/libmdb/write.c: Fix bug in handling certain 'jump tables'
|
||||||
|
* src/util/mdb-schema.c: Handle 'file not found' case
|
||||||
|
|
||||||
Mon May 2 07:28:58 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
Mon May 2 07:28:58 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
||||||
* include/mdbtools.h:
|
* include/mdbtools.h:
|
||||||
|
|||||||
@@ -62,18 +62,23 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mdb_init();
|
mdb_init();
|
||||||
|
|
||||||
/* open the database */
|
/* open the database */
|
||||||
|
mdb = mdb_open (argv[optind], MDB_NOFLAGS);
|
||||||
mdb = mdb_open (argv[optind], MDB_NOFLAGS);
|
if (!mdb) {
|
||||||
if (argc - optind >= 2) {
|
fprintf(stderr, "Could not open file\n");
|
||||||
if (!mdb_set_default_backend(mdb, argv[optind + 1])) {
|
|
||||||
fprintf(stderr,"Invalid backend type\n");
|
|
||||||
mdb_exit();
|
mdb_exit();
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if (argc - optind >= 2) {
|
||||||
|
if (!mdb_set_default_backend(mdb, argv[optind + 1])) {
|
||||||
|
fprintf(stderr, "Invalid backend type\n");
|
||||||
|
mdb_exit();
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* read the catalog */
|
/* read the catalog */
|
||||||
if (!mdb_read_catalog (mdb, MDB_TABLE)) {
|
if (!mdb_read_catalog (mdb, MDB_TABLE)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user