Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 757f170

Browse files
[[ Bug 20013 ]] RevDB database types should be case insensitive.
The database type passed to revOpenDatabase is used by revdb to find the appropriate driver. Make sure we convert the type to lowercase in order to find the correct driver in case sensitive systems (the driver file names are all lowercase).
1 parent 9c876db commit 757f170

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

docs/notes/bugfix-20013.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Database type passed to revOpenDatabase should be case insensitive

revdb/src/revdb.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,26 +291,30 @@ DATABASEREC *LoadDatabaseDriver(const char *p_type)
291291
{
292292
DATABASEREC *t_database_rec = nullptr;
293293

294+
char t_type[32];
295+
strcpy(t_type, p_type);
296+
strlwr(t_type);
297+
294298
if (revdbdriverpaths != nullptr)
295299
{
296300
t_database_rec = LoadDatabaseDriverInFolder(revdbdriverpaths, p_type);
297301
}
298302
else
299303
{
300-
t_database_rec = LoadDatabaseDriverInFolder(".", p_type);
304+
t_database_rec = LoadDatabaseDriverInFolder(".", t_type);
301305

302306

303307
if (t_database_rec == nullptr)
304308
t_database_rec = LoadDatabaseDriverInFolder("./Database Drivers",
305-
p_type);
309+
t_type);
306310

307311
if (t_database_rec == nullptr)
308312
t_database_rec = LoadDatabaseDriverInFolder("./database_drivers",
309-
p_type);
313+
t_type);
310314

311315
if (t_database_rec == nullptr)
312316
t_database_rec = LoadDatabaseDriverInFolder("./drivers",
313-
p_type);
317+
t_type);
314318
}
315319

316320
if (t_database_rec != nullptr)

0 commit comments

Comments
 (0)