mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-07-29 23:58:03 -05:00
Move g_strdup inside of set_log_level to be a slightly better citizen and fix a serious bug. :/
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16402 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -196,7 +196,7 @@ qof_log_set_level(QofLogModule log_module, QofLogLevel level)
|
|||||||
{
|
{
|
||||||
log_table = g_hash_table_new(g_str_hash, g_str_equal);
|
log_table = g_hash_table_new(g_str_hash, g_str_equal);
|
||||||
}
|
}
|
||||||
g_hash_table_insert(log_table, (gpointer)log_module, GINT_TO_POINTER((gint)level));
|
g_hash_table_insert(log_table, g_strdup((gchar*)log_module), GINT_TO_POINTER((gint)level));
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
@@ -329,7 +329,7 @@ qof_log_check(QofLogModule log_domain, QofLogLevel log_level)
|
|||||||
_QLC_DBG({ printf("trying [%s] (%d):", log_domain, g_hash_table_size(log_levels)); });
|
_QLC_DBG({ printf("trying [%s] (%d):", log_domain, g_hash_table_size(log_levels)); });
|
||||||
if (G_LIKELY(log_levels))
|
if (G_LIKELY(log_levels))
|
||||||
{
|
{
|
||||||
// e.g., "a.b.c" -> "a\0b.c" -> "a.b\0c", "a.b.c"
|
// e.g., "a.b.c\0" -> "a\0b.c\0" -> "a.b\0c\0", "a.b.c\0"
|
||||||
gpointer match_level;
|
gpointer match_level;
|
||||||
while ((dot_pointer = g_strstr_len(dot_pointer, strlen(dot_pointer), ".")) != NULL)
|
while ((dot_pointer = g_strstr_len(dot_pointer, strlen(dot_pointer), ".")) != NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user