[dconf] engine: fix checking for locks



commit 33f32ba175c6192d500ed7081d3cf973e724379a
Author: Ryan Lortie <desrt desrt ca>
Date:   Fri Feb 3 10:03:17 2012 -0500

    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.

 engine/dconf-engine.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/engine/dconf-engine.c b/engine/dconf-engine.c
index 8f5c613..c3b28ff 100644
--- a/engine/dconf-engine.c
+++ b/engine/dconf-engine.c
@@ -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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]