diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-22 15:10:49 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-22 15:10:49 +0100 |
commit | d038f192c7dcb453c9fc19082cd1b642c8f70fc8 (patch) | |
tree | bcb539657cd8b35ed742f19e5673c777ab39610c /src/crepe/facade/DB.cpp | |
parent | c3c3476f1d82aa83d8f8dc706488475dc2cf1e55 (diff) | |
parent | 4117d1d287f1d87efd0577d56819520e981a7f1c (diff) |
merge with `master`
Diffstat (limited to 'src/crepe/facade/DB.cpp')
-rw-r--r-- | src/crepe/facade/DB.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crepe/facade/DB.cpp b/src/crepe/facade/DB.cpp index d5d19dc..95cf606 100644 --- a/src/crepe/facade/DB.cpp +++ b/src/crepe/facade/DB.cpp @@ -18,8 +18,8 @@ DB::DB(const string & path) { this->db = {db, [](libdb::DB * db) { db->close(db, 0); }}; // load or create database file - ret = this->db->open(this->db.get(), NULL, path.c_str(), NULL, libdb::DB_BTREE, DB_CREATE, - 0); + const char * file = path.empty() ? NULL : path.c_str(); + ret = this->db->open(this->db.get(), NULL, file, NULL, libdb::DB_BTREE, DB_CREATE, 0); if (ret != 0) throw runtime_error(format("db->open: {}", libdb::db_strerror(ret))); // create cursor |