Commit 33f32ba1 authored by Allison Karlitskaya's avatar Allison Karlitskaya
Browse files

engine: fix checking for locks

The algorithm that checked for locks essentially answers the question of
"what is the highest level database that we should consider results
from?".  In the case of only one database, its answer to this question
could be out of range of the set of databases that we asked it to search
in.

Correct this problem by bounding the starting point of the search
accordingly.

Reported by Didier Roche.
parent 7131b6eb
......@@ -397,7 +397,7 @@ dconf_engine_read_internal (DConfEngine *engine,
* ensure that values in the user database are always ignored when
* locks are present.
*/
for (i = engine->n_dbs - 1; lowest < i; i--)
for (i = MAX (engine->n_dbs - 1, lowest); lowest < i; i--)
if (engine->lock_tables[i] != NULL &&
gvdb_table_has_value (engine->lock_tables[i], key))
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment